6
votes

I am using RStudio (Version 0.99.484) and R (Version 3.2.3) on Mac OSX (Version 10.9.5).

Unfortunately, I cannot recall if I did anything to cause these changes, but since about two weeks ago, whenever I try to install certain package from CRAN, upon using the usual syntax:

install.packages("packageName")

I receive an Error Message in RStudio. Here is an example of a new package for which I see this issue:

install.packages("plotly")

Gives me the Error Message:

  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’

This has happened for more than one packages (and seems sudden, the past two weeks). However, it does not happen for all packages. I am wondering how to approach this issue given my use of RStudio, Mac OSX, R, etc. I see very few resources when Googling my Error Message "sub-architecture 'R' is not installed".

Upon running 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"
1
try utils::install.packages("packageName")jangorecki
@luckButtered This may be RStudio related issue, RStudio replaces default install.packages (type in RStudio install.packages and utils::install.packages). RStudio may use the same processes in devtools::install_github that's why you may be able to get same error from there. But I'm just guessing.jangorecki
You could try reinstalling Rstudio after saving all existing packagesBas
Have you tried (re)installing the packages from source? Note that you'd need the Command Line Tools on Mac OS X.Roland
Try with dependencies and type. first try without type, use only dependencies: install.packages("packageName", type="mac.binary", dependencies=TRUE)Nejc Galof

1 Answers

1
votes

In looking at the dependence for Plotly it looks as though it requires a ggplot2 version with R ≥ 3.1. So just update your base R to version 3.1 or newer and it'll work. It isn't your Rstudio but your base R which importantly is different.

If all else fails try installing to windows 10, Rstudio version 0.99.892 and R 3.2.4 as I was not able to replicate this problem using using these versions which happen to be the most up to date.