我正在尝试使用 tmap 和其他映射和空间统计包。当我尝试加载 tmap 的库时,出现错误:
library(tmap)
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘units’
In addition: Warning message:
package ‘tmap’ was built under R version 3.3.3
Error: package or namespace load failed for ‘tmap’
Then I tried installing the units package with and without dependencies.
无论哪种方式,尝试安装它时都会遇到相同的错误。
install.packages("units", dependencies = FALSE)
Installing package into ‘C:/Users/hello/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
There is a binary version available but the source version
is later:
binary source needs_compilation
units 0.5-1 0.6-0 FALSE
installing the source package ‘units’
trying URL 'https://muug.ca/mirror/cran/src/contrib/units_0.6-0.tar.gz'
Content type 'application/x-gzip' length 912393 bytes (891 KB)
downloaded 891 KB
* installing *source* package 'units' ...
** package 'units' successfully unpacked and MD5 sums checked
**********************************************
WARNING: this package has a configure script
It probably needs manual configuration
**********************************************
** libs
*** arch - i386
Warning: running command 'make -f "Makevars.win" -f "C:/PROGRA~1/R/R-33~1.2/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-33~1.2/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="units.dll" OBJECTS="RcppExports.o io.o udunits.o"' had status 127
ERROR: compilation failed for package 'units'
* removing 'C:/Users/hello/Documents/R/win-library/3.3/units'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.2/bin/x64/R" CMD INSTALL -l "C:UsershelloDocumentsRwin-library3.3" C:UsershelloAppDataLocalTempRtmp0QIIHG/downloaded_packages/units_0.6-0.tar.gz' had status 1
Warning in install.packages :
installation of package ‘units’ had non-zero exit status
The downloaded source packages are in
‘C:UsershelloAppDataLocalTempRtmp0QIIHGdownloaded_packages’
对此的任何帮助都会很棒!
我只是遇到了同样的问题,然后我尝试install.packages("units", type='binary')
,然后能够安装和加载tmap。