6

我正在尝试建立一个像这里的图表

从链接安装不起作用:

`install.packages('Rcartogram', repos = 'http://www.omegahat.org/R', type = 'source')`
Installing package into ‘C:/Users/Milena/Documents/R/win-library/3.2’
(as `lib` is unspecified)

Warning in install.packages :
  package ‘Rcartogram’ is not available (for R version 3.2.0)

既不是来自 zip 文件:

install.packages("C:/Users/Milena/Downloads/Rcartogram_0.2-2.tar.gz", repos = NULL, type = "source")

将包安装到'C:/Users/Milena/Documents/R/win-library/3.2'(lib未指定)*安装Rcartogram... **********************************************
WARNING: this package has a configure script It probably needs manual configuration **********************************************

** 库

*** arch - i386 警告:运行命令 'make -f "Makevars" -f "C:/PROGRA~1/R/R-3.2.0/etc/i386/Makeconf" -f "C:/PROGRA~1 /R/R-3.2.0/share/make/winshlib.mk" SHLIB="Rcartogram.dll" OBJECTS="Rcart.o cart.o"' 状态为 127 错误:包 'Rcartogram' 的编译失败 * 删除' C:/Users/Milena/Documents/R/win-library/3.2/Rcartogram' install.packages 中的警告:运行命令'"C:/PROGRA~1/R/R-3.2.0/bin/x64/R" CMD INSTALL -l "C:\Users\Milena\Documents\R\win-library\3.2" "C:/Users/Milena/Downloads/Rcartogram_0.2-2.tar.gz"' 在安装中有状态 1 警告。包:安装包“C:/Users/Milena/Downloads/Rcartogram_0.2-2.tar.gz”的退出状态非零

我怎么解决这个问题?

我在Windows机器上工作。

感谢所有花时间查找这个问题的人。

这是我的sessionInfo

R version 3.2.0 (2015-04-16)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 x64 (build 9200)

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252    LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] fftw_1.0-3

loaded via a namespace (and not attached):
[1] tools_3.2.0
4

2 回答 2

15
于 2015-07-26T00:19:39.640 回答
0

要安装 Rcartogram,您需要从网站http://www.omegahat.org/Rcartogram/下载软件包并从源代码安装。打开终端(在 Windows 中,它称为命令提示符),将目录更改为下载文件所在的位置并输入:R CMD INSTALL Rcartogram_0.2-2.tar.gz

该命令是从源代码安装 R 包。为此,您将需要一个有效的 C 编译器。从您的错误消息来看,您的 C 编译器似乎存在一些问题。确保它是否有效(或者你有一个)。看看这个问题:Windows 的 C 编译器?

于 2015-07-25T02:17:16.610 回答