Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation on how to override defaults and *not* install binary versions of packages? #631

Closed
Robinlovelace opened this issue Apr 8, 2023 · 5 comments
Labels

Comments

@Robinlovelace
Copy link
Contributor

Container image name

rocker/geospatial

Container image digest

Not sure

What operating system related to this question?

Linux

System information

Not relevant

Question

Can the documentation explain how to override the defaults to install everything from binary versions shipped by RStudio? I need to re-compile sf but install.packages("sf") fails with the following:

install.packages("sf")
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://packagemanager.posit.co/cran/__linux__/jammy/latest/src/contrib/sf_1.0-12.tar.gz'
Content type 'binary/octet-stream' length 3498486 bytes (3.3 MB)

I've tried adding type = "source" and a few other things but the only way I got it to work was installing from GitHub with

remotes::install_github("r-spatial/sf")

I think this documentation would live well here: https://rocker-project.org/use/extending.html

Context with reproducible example you can try: geocompx/geocompr#948 (comment)

@eddelbuettel
Copy link
Member

eddelbuettel commented Apr 8, 2023

Have you tried changing the value of options("repos") ?

For this particular stack the value is considered a feature, not a bug.

@cboettig
Copy link
Member

cboettig commented Apr 8, 2023

@Robinlovelace thanks, yeah we should document this better -- it is annoying that RSPM snapshots don't honor type="source" on install.packages(). To install from source using RSPM repos you simply drop the architecture bits from the repo URL, i.e. drop the __linux__/jammy

options(repos = "https://packagemanager.posit.co/cran/latest")

(or similar for the versioned snapshots. Obviously for 'latest' installs from source you can also just point at CRAN). Note that the rocker/geospatial:dev-osgeo tags do this by default, since we need to build sf and friends against the manually compiled latest versions of osgeo)

Where would be the most obvious place to document this?

@Robinlovelace
Copy link
Contributor Author

Somewhere in this page was my thinking, but not sure where: https://rocker-project.org/use/extending.html

@eitsupi
Copy link
Member

eitsupi commented May 13, 2023

I think this is documented on this page.
https://rocker-project.org/images/versioned/r-ver.html#switch-the-default-cran-mirror

It would be very helpful if you could submit a PR for improvement on this page.

@eitsupi eitsupi closed this as not planned Won't fix, can't repro, duplicate, stale May 13, 2023
@Robinlovelace
Copy link
Contributor Author

I'm going to give you suggestion a go @cboettig, finally:

options(repos = "https://packagemanager.posit.co/cran/latest")

I will tag this issue in the commits in case of use. Will try to make edits to that page also @eitsupi thanks for the suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants