Coder Social home page Coder Social logo

Comments (10)

rpodcast avatar rpodcast commented on September 7, 2024

Another situation (somewhat related) is when the user bootstraps a project with renv and the cache is used, but later on decides to disable use of the cache with renv::settings$use.cache(FALSE). I would hope that immediately after disabling the cache, the packages from the cache would either be automatically copied or the user would get a prompt to begin the copying process.

from renv.

kevinushey avatar kevinushey commented on September 7, 2024

@rpodcast I implemented that behavior with 98dcfad -- now, toggling the use.cache setting will copy packages to / from the cache as appropriate.

from renv.

rpodcast avatar rpodcast commented on September 7, 2024

Excellent! I just did a quick test and packages were immediately copied to the project dir after running renv::settings$use.cache(FALSE). I'm really digging how snappy and fast renv runs even in this early stage.

from renv.

strazto avatar strazto commented on September 7, 2024

Just speaking to this - I have packages that I am only able to install via install_git, which doesn't have a shim for renv.

This results in a private library install, which I'm happy enough with, but my problem is that I can't call renv::settings$use.cache(FALSE), without it throwing me the error "Error: source file '~/.local/share/renv/R-3.5/cache/v2//0.1.6.9001/<long_hash>/' does not exist"

from renv.

strazto avatar strazto commented on September 7, 2024

is the fix to instruct Renv to ignore my private packages?

from renv.

slopp avatar slopp commented on September 7, 2024

@mstr3336 slightly tangential, but do you have your package available in a CRAN-like repository as well? Or do you plan to? (e.g. miniCRAN, drat, RStudio Package Manager, etc)

from renv.

kevinushey avatar kevinushey commented on September 7, 2024

@mstr3336 Can you be a bit more explicit on what you were trying to do, and what failed? A reproducible example would be helpful.

from renv.

kevinushey avatar kevinushey commented on September 7, 2024

It's worth saying that you should be able to install packages from Git using remotes::install_git("<url>"), and renv should understand how to snapshot + restore such packages.

from renv.

strazto avatar strazto commented on September 7, 2024

@kevinushey

@mstr3336 slightly tangential, but do you have your package available in a CRAN-like repository as well? Or do you plan to? (e.g. miniCRAN, drat, RStudio Package Manager, etc)

I don't intend to in the near future, personally I'd be more than okay with publishing it but my boss doesn't want to.

@mstr3336 Can you be a bit more explicit on what you were trying to do, and what failed? A reproducible example would be helpful.

I suppose I could make a reprex with a minimal package skeleton, though making a reprex that captures my work's enterprise server setup is a little less feasible.

The main thing I was trying to do was disable the cache on my work's HPC for portability, because the R project in installed to a folder shared across my team and I didn't want to deal with configuring the cache path to be within the share.

This looked like

install_git("<url>", credentials = "access_token")
# Installs to 'projectroot/renv/library' , 
# rather than to '~/.local/share/renv/R-3.5/cache/v2//0.1.6.9001/<long_hash>/'

renv::settings$use.cache(FALSE)
# "Error: source file '~/.local/share/renv/R-3.5/cache/v2//0.1.6.9001/<long_hash>/' does not exist"

It's worth saying that you should be able to install packages from Git using remotes::install_git("<url>"), and renv should understand how to snapshot + restore such packages.

renv is actually very good at handling my snapshots/restores, though! (A lot less pain than packrat )

from renv.

kevinushey avatar kevinushey commented on September 7, 2024

While the primary request here is solved with renv::settings$use.cache(FALSE), I think we may also want a more direct API (e.g. renv::isolate() or something like that).

from renv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.