我试着用这些创建一个Map:
library(sf)
library(ggplot2)
library(ggthemes)
我一直没办法,因为它一直显示
library(sf)
Error: package or namespace load failed for ‘sf’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): there is no package called ‘classInt’
Además: Warning message: package ‘sf’ was built under R version 4.1.0
library(leaflet)
Error: package or namespace load failed for ‘leaflet’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): there is no package called ‘crosstalk’
Además: Warning message: package ‘leaflet’ was built under R version 4.1.0
estadosmx <- st_read('https://raw.githubusercontent.com/angelnmara/geojson/master/mexicoHigh.json')
Error in st_read("https://raw.githubusercontent.com/angelnmara/geojson/master/mexicoHigh.json") : no se pudo encontrar la función "st_read"
install.packages("st_read")
Installing package into ‘C:/Users/Jorge escobar/Documents/R/win-library/4.0’ (as ‘lib’ is unspecified)
Warning in install.packages : package ‘st_read’ is not available (for R version 4.0.2)
1条答案
按热度按时间qfe3c7zg1#
因为没有答案,因为我看了很长时间这篇文章,它对我来说并不清楚,我将发布帮助我克服这个错误的东西。我以前运行过我的脚本,它工作得很好,所以我不认为这是一个环境或安装问题。我的问题是因为我之前的Rstudio会话从我在该会话中运行的脚本加载了库,而不一定在我调用st_read()的脚本中。当我在一个新的会话中重新加载我的脚本并试图运行st_read()时,并不明显它来自sf库(它是从另一个脚本加载的)。希望这对其他人有帮助;
st_read()仅在sf库加载后可用。