Problem:
sbf_save_plot() fails to save the xlsx when the plot has a spatial layer because it can't save the geometry column in an xlsx file.
Steps to reproduce this behaviour:
library(sf)
library(ggplot2)
library(subfoldr2)
shp <- st_as_sf(data.frame(x = c(1, 2), y = c(10, 15)),
coords = c("x", "y"))
ggplot(shp) + geom_sf()
sbf_save_plot(last_plot(), "plot", caption = "Caption.")
# Error:
# ! writexl cannot write column(s) of these types:
# 'geometry' (column 1): sfc_POINT/sfc (list)
Expected output/desired solution:
Drop the geometry column before saving the plot.
Problem:
sbf_save_plot()fails to save the xlsx when the plot has a spatial layer because it can't save the geometry column in an xlsx file.Steps to reproduce this behaviour:
Expected output/desired solution:
Drop the geometry column before saving the plot.