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

Adding repo from ropensci #592

Open
jasonjb82 opened this issue Feb 7, 2020 · 6 comments
Open

Adding repo from ropensci #592

jasonjb82 opened this issue Feb 7, 2020 · 6 comments

Comments

@jasonjb82
Copy link

I am trying to take a snapshot of my project that includes the following package

install.packages("rnaturalearthhires", repos = "http://packages.ropensci.org", type = "source")

Unfortunately, when I run packrat:status(), I get the following error

Error: Unable to retrieve package records for the following packages:
- "rnaturalearthhires

Do you know how I could add this repo so I can add this package to my snapshot?

@kevinushey
Copy link
Contributor

You need to add it to the repos R option; e.g.

options(repos = c(getOption("repos"), ROpenSci = "http://packages.ropensci.org"))

After doing this you'll likely need to call packrat::snapshot() to update the lockfile as well.

@jasonjb82
Copy link
Author

Thanks for this, Kevin.

I tried adding the repo which now shows me this when I type getOption("repos")

                          CRAN                       ROpenSci 
   "https://cran.rstudio.com/" "http://packages.ropensci.org"

However, when I call packrat::snapshot() again, it still gives me the same error

@kevinushey
Copy link
Contributor

Are you working on macOS? The CRAN binary repository is currently broken and that is affecting Packrat as well.

@jasonjb82
Copy link
Author

No, I use a Windows 10 machine. Just wondering how exactly this is affecting me adding this repo and creating a new snapshot.

@kevinushey
Copy link
Contributor

The problem is that the installed package does not indicate it is from a package repository:

> desc <- read.dcf(
+   system.file("DESCRIPTION", package = "rnaturalearthhires"),
+   all = TRUE
+ )
> desc$Repository
NULL

You can install the development version of Packrat if you need to work around this issue:

remotes::install_github("rstudio/packrat")

And note that you'll still need to set the repos option to list both of your package repositories.

@jasonjb82
Copy link
Author

Thanks @kevinushey, I'll try this.

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

No branches or pull requests

2 participants