我目前在Windows上运行R版本3.4.2并且有ggplot2(通过tidyverse)和sf包版本3.4.2.我正在尝试使用ggplot2 sf工具包映射空间数据.
尝试运行geom_sf时,收到错误:could not find function "geom_sf".
当我使用ggplot2包搜索时ls("package:ggplot2"),geom_sf未列在库文件中.
我安装了devtools并跑了devtools::install_github("tidyverse/ggplot2").但是,我收到一个错误:Installation failed: Failed to connect to raw.githubusercontent.come port 443: Timed out.我认为工作中的防火墙正在停止此连接.
为了解决这个问题,我尝试从https://github.com/tidyverse/ggplot2手动下载zip 并运行install.packages('ggplot2-master.zip', lib = 'C:/filepath')并收到错误:package 'ggplot2-master.zip' is not available (for R version 3.4.2).在我从3.4.1更新之前,我遇到了同样的错误.
TLDR:我遇到与此用户相同的问题:绘制sf对象时出错---错误:无法找到函数"geom_sf" 但解决方案对我不起作用.
有谁看到我可能遗失的东西?或者如何访问这个高度引用(更简化)的包?