绘制sf对象时出错---错误:找不到函数“geom_sf” [英] Error when plotting sf object --- Error: could not find function "geom_sf"
问题描述
我目前在Windows上运行R版本3.3.3,并具有ggplot2版本2.2.1和sf软件包版本0.5-4,并且出现错误,指出R无法找到函数geom_sf。
我预计会找到该函数,因为它在Tidyverse文档中列出 http://ggplot2.tidyverse.org/reference/ggsf.html 。
ls(package:ggplot2)
没有显示geom_sf作为一个包含的函数,我在库文件中找不到它。
有人知道我该如何得到这个难以捉摸的软件包吗?
以管理员身份运行R时,重新安装ggplot2:
devtools :: install_github(tidyverse / ggplot2)
require(ggplot2)
$ b您应该能够看到它?geom_sf
有关相关问题要使用devtools,请参阅此 SO答案 。
I'm currently running R Version 3.3.3 on Windows and have ggplot2 version 2.2.1 and the sf package version 0.5-4 and am getting an error saying that R could not find the function "geom_sf."
I expected to find the function because it is listed in 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 might get this elusive package?
解决方案While running R as the administrator, reinstall ggplot2 like this:
devtools::install_github("tidyverse/ggplot2") require(ggplot2)
You should be able to see it now with ?geom_sf
For questions related to using devtools, see this SO answer.
这篇关于绘制sf对象时出错---错误:找不到函数“geom_sf”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!