Code Monkey home page Code Monkey logo

Comments (10)

ktoddbrown avatar ktoddbrown commented on June 21, 2024 1

Sorry! I'm looking to download pangaea data to a specified local directory and then load the data into R and be able to work with it offline. I'm running the below function (and data set):

data.df <- pangaear::pg_data(doi = '10.1594/PANGAEA.863689')

from pangaear.

sckott avatar sckott commented on June 21, 2024

Thanks for this. Are you talking about a specific function?

from pangaear.

sckott avatar sckott commented on June 21, 2024

@ktoddbrown what "environmental variables" are you talking about?

from pangaear.

sckott avatar sckott commented on June 21, 2024

we store the base path to save files to in env$path, so in theory you could change that path, but it's not exported to the user right now. i can see about letting the user set the working directory

from pangaear.

ktoddbrown avatar ktoddbrown commented on June 21, 2024

Yep, this is what I was interested in.

from pangaear.

sckott avatar sckott commented on June 21, 2024

can you reinstall remotes::install_github("ropensci/pangaear@cache-path"), restart R session, and try again. See pg_cache$cache_path_set() to set the cache path

from pangaear.

sckott avatar sckott commented on June 21, 2024

changes in caa3cb3

from pangaear.

ktoddbrown avatar ktoddbrown commented on June 21, 2024

This is not quite what I was looking for. I would like to download the files to a specified directory. For example right now

> pg_cache$cache_path_set('/Users/name/Documents/Datasets')
[1] "/Users/name/Library/Caches/R//Users/name/Documents/Datasets"
> pg_cache$cache_path_get()
[1] "/Users/name/Library/Caches/R//Users/name/Documents/Datasets"

but I would like to point the director to: the folder "/Users/name/Documents/Datasets"

from pangaear.

sckott avatar sckott commented on June 21, 2024

I've been planning to make it easier to set the path directly ropensci/hoardr#12 but not done yet. for now try this:

x = pg_cache
x
#> <hoard>
#>   path: pangaear
#>   cache path: /Users/sckott/Library/Caches/R/pangaear
iset_the_path <- function(path) x$.__enclos_env__$private$hoard_env$cache_path <- path
iset_the_path("/Users/name/Documents/Datasets")
x
#> <hoard>
#>   path: pangaear
#>   cache path: /Users/name/Documents/Datasets

from pangaear.

sckott avatar sckott commented on June 21, 2024

@ktoddbrown sorry for the very long wait on this - done now - can install from github master branch. just set your own path with pg_cache$cache_path_set(full_path = "/Foo/Bar")

from pangaear.

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.