我在Mac OSX(版本10.9.5)上使用RStudio(版本0.99.484)和R(版本3.2.3).
不幸的是,我不记得我是否做了任何导致这些更改的事情,但是大约两周前,每当我尝试从CRAN 安装某个软件包时,使用通常的语法:
install.packages("packageName")
Run Code Online (Sandbox Code Playgroud)
我收到RStudio中的错误消息.这是一个新包的示例,我看到了这个问题:
install.packages("plotly")
Run Code Online (Sandbox Code Playgroud)
给我错误信息:
There is a binary version available but the source version is later:
binary source needs_compilation
plotly 2.0.16 3.4.1 FALSE
installing the source package ‘plotly’
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 343 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
38 1039k 38 399k 0 0 1724k 0 --:--:-- --:--:-- --:--:-- 1724k100 1039k 100 1039k 0 0 3376k 0 --:--:-- --:--:-- --:--:-- 8521k
* installing *source* package ‘plotly’ ...
** package ‘plotly’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Warning: package ‘ggplot2’ was built under R version 3.2.4
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
*** arch - R
ERROR: sub-architecture 'R' is not installed
*** arch - x86_64
Warning: package ‘ggplot2’ was built under R version 3.2.4
ERROR: loading failed for ‘R’
* removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/plotly’
Warning in install.packages :
installation of package ‘plotly’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/vn/lhzbs8ds6xbg965nnfcj6ftm0000gn/T/RtmpmyVFR4/downloaded_packages’
Run Code Online (Sandbox Code Playgroud)
这种情况发生在不止一个包裹上(过去两周似乎突然发生).但是,并非所有包都会发生.我想知道如何处理这个问题,因为我使用了RStudio,Mac OSX,R等.当谷歌搜索我的错误消息"未安装子架构'R'时,我看到的资源非常少".
在运行R.Version()时:
$platform
[1] "x86_64-apple-darwin13.4.0"
$arch
[1] "x86_64"
$os
[1] "darwin13.4.0"
$system
[1] "x86_64, darwin13.4.0"
$status
[1] ""
$major
[1] "3"
$minor
[1] "2.3"
$year
[1] "2015"
$month
[1] "12"
$day
[1] "10"
$`svn rev`
[1] "69752"
$language
[1] "R"
$version.string
[1] "R version 3.2.3 (2015-12-10)"
$nickname
[1] "Wooden Christmas-Tree"
Run Code Online (Sandbox Code Playgroud)
小智 1
在查看 Plotly 的依赖性时,它看起来好像需要带有 R \xe2\x89\xa5 3.1 的 ggplot2 版本。因此,只需将您的基础 R 更新到版本 3.1 或更高版本即可。重要的是,它不是您的 Rstudio,而是您的基础 R。
\n\n如果所有其他方法都失败,请尝试安装到 Windows 10、Rstudio 版本 0.99.892 和 R 3.2.4,因为我无法使用这些恰好是最新的版本来复制此问题。
\n