Skip to content

Possible to "create" renvs at a path other than home directory? #1

@colearendt

Description

@colearendt

I feel like I am seeing some type of weirdness with renvs that are tried with a path.

library(reprex)
renv::init()
#> * Virtual environment 'reprex548277d89f6' activated -- please restart the R session.
renv::activate()
#> * Virtual environment 'reprex548277d89f6' activated -- please restart the R session.
text <- "blahblah2"
renv::create(paste0("/", text))
system("ls ~/.renv/environment", intern = TRUE)
#> [1] "blah" "tmp"

system("ls ./", intern = TRUE)
#> [1] "renv"                   "reprex_reprex.R"       
#> [3] "reprex_reprex.spin.R"   "reprex_reprex.spin.Rmd"

renv::deactivate()
#> * Virtual environment deactivated -- please restart the R session.
renv::create(paste0("/tmp/", text))
system("ls ~/.renv/environment", intern = TRUE)
#> [1] "blah" "tmp"
system("ls ~/.renv/environment/tmp/", intern = TRUE)
#> [1] "blah"
renv::create(paste0("./", text))
#> Error: Local virtual environment './blahblah2' already exists.
system("ls ~/.renv/environment", intern = TRUE)
#> [1] "blah" "tmp"

system("ls ./", intern = TRUE)
#> [1] "renv"                   "reprex_reprex.R"       
#> [3] "reprex_reprex.spin.R"   "reprex_reprex.spin.Rmd"

Created on 2019-01-03 by the reprex package (v0.2.1)

I think this relates to my preferences in virtualenv 😄

Not sure if renv::init() is the only way you can get a renv within a project, and whether any project would ever be justified in having more than one renv locally.

The other use case to wonder about here is whether you could put renvs or the cache at a shared location. This is something that I know some users were interested in for packrat.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions