Skip to content

plot() returns error with stars object in ea_spatial data slot #63

@claysa

Description

@claysa

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.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions