I have no problems loading any of the libraries or data, but when I run the geom_sf() function, I get the following error:
Don't know how to automatically pick scale for object of type standardGeneric. Defaulting to continuous.
Error: All columns in a tibble must be 1d or 2d objects:
Column geometry is standardGeneric
Call rlang::last_error() to see a backtrace
I have the latest version of R, and I've tried uninstalling and re-installing R and running the same code without any luck. Even after I run devtools::install_github("tidyverse/ggplot2"), the version of ggplot on my machine is 3.0, but I need 3.1 to run geom_sf(). Is there another way to install the development version of ggplot without using devtools::install_github("tidyverse/ggplot2")? Or, is there a different reason why I might be having this issue?
Why are you rerunning this after installing ggplot2 already? This is another way of installing a package. The version on CRAN is 3.1.0, so you should be fine with the CRAN version, and shouldn't need to install it again.
Error in FUN(X[[i]], ...) : object 'geometry' not found
Have you loaded your data in at this point?
Note that, in order to plot something with geom_sf() it needs to meet certain specifications/you need to tell it how to reference the information correctly. From
Geometry aesthetic
geom_sf() uses a unique aesthetic: geometry , giving an column of class sfc containing simple features data. There are three ways to supply the geometry aesthetic:
Do nothing: by default geom_sf() assumes it is stored in the geometry column.
Explicitly pass an sf object to the data argument. This will use the primary geometry column, no matter what it's called.
Supply your own using aes(geometry = my_column)
Unlike other aesthetics, geometry will never be inherited from the plot