Plotting an ea_spatial object with a stars object in the data slot returns an error (see reproducible example below).
library(stars)
library(marea)
df <- expand.grid(x=1:4, y=1:4, time=1:2)
df$value <- 1:nrow(df)
df <- st_as_stars(df, dims = c("x","y","time"))
df <- as_ea_spatial(df, value_col="value")
plot(df@data)
plot(df, style="fill")
The first "plot" is successful, but the second returns this error:
Error in fortify():
! data must be a <data.frame>, or an object coercible by fortify(), or a valid
<data.frame>-like object coercible by as.data.frame().
Caused by error in .prevalidate_data_frame_like_object():
! dim(data) must return an of length 2.