An error occurred while building the sf object --- Error: the geom_sf function could not be found

I am currently running R version 3.3.3 on Windows and have ggplot2 version 2.2.1 and sf package version 0.5-4, and I get an error message that R cannot find the geom_sf function.

I expected to find a function because it is listed in the Tidyverse documentation at http://ggplot2.tidyverse.org/reference/ggsf.html .

The output of ls("package:ggplot2") did not show "geom_sf" as an included function, and I could not find it in the library files.

Does anyone know how I can get this elusive package?

+7
r ggplot2
source share
1 answer

When starting R as an administrator, reinstall ggplot2 as follows:

 devtools::install_github("tidyverse/ggplot2") require(ggplot2) 

Now you can see it with geom_sf

For questions about using devtools, see this SO answer .

+8
source share

All Articles