Q. Trying out RStudio Package Manager for binary Linux pkgs (packagemanager.rstudio.com/c…). It works in RStudio *Console*:
* installing *binary* package ‘ggplot2’ ...
Elsewhere w/ verbatim settings download the source:
* installing *source* package ‘ggplot2’ ...
Why?
/1
#RStats
1
2
options(repos="packagemanager.rstudio.com/a…")
Same URL packagemanager.rstudio.com/a… is downloaded but in RStudio Console I get
Content type 'binary/octet-stream' length 4053324 bytes (3.9 MB)
and in vanilla R, it get
Content type 'binary/octet-stream' length 3045519 bytes (2.9 MB)
/2
2
Does the RStudio Console tweak the User-Agent header or something to download a different file from the same URL?
1
Ah... it's in the FAQ (docs.rstudio.com/rspm/admin/…). Solution:
options(HTTPUserAgent = sprintf("R/%s R (%s)", getRversion(), paste(getRversion(), R.version$platform, R.version$arch, R.version$os)))
Then
options(repos="packagemanager.rstudio.com/a…")
install.packages("ggplot2")
works!
1
1
8
Script installRSPM.r in littler automates this.
See the gif below (where I have to say 'focal' to get the LTS, I am non-LTS 'groovy'). We also have rocker/r-rspm for this (but I think rocker/r-bspm is cooler).
#rstats #RockerProject
Apr 10, 2021 · 8:13 PM UTC
2
3
GIF

