Error in `geom_sf()

Error in geom_sf():
! Problem while computing stat.
i Error occurred in the 1st layer.
Caused by error in compute_layer():
! stat_sf() requires the following missing aesthetics: geometry

Could you give a bit more information about what you tried to do? Ideally a reprex? Your error is giving you information on how to diagnose the issue, but folks here won't be able to help without additional context.

df is a .xls
map is .shp
map_merge <- left_join (df, map, by = "code")
clas (map_merge)
[1] "tbl_df" "tbl" "data.frame"

map_merge %>%
ggplot (aes(fill = column)) +
geom_sf()

Error in geom_sf():
! Problem while computing stat.
i Error occurred in the 1st layer.
Caused by error in compute_layer():
! stat_sf() requires the following missing aesthetics: geometry
Run rlang::last_error() to see where the error occurred.

Try with the spatial file on the left side, e.g. left_join (map, df, by = "code"). This should produce an sf object (if map was an sf object).

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.