@sckott I presume you won't be looking at this, but ping nonetheless just in case. I'll give you a couple of days, otherwise i'll merge by end of week regardless.
Description
@trashbirdecology @krzbar Hi there, I've taken over maintenance of this package now. This PR implements an ability to specify the cache directory used by rdryad. Functionality demonstrated in the reprex below.
The previous version used the .onLoad line dryad_cache <<- <...>. As well as the problems identified in #34, #35, that failed in many places anyway, notably including calls embedded within other processes or threads. This PR stores the hoardr object specifying the cache in options(), which are faithfully copied and passed between all callr processes, so this approach should be more robust.
Related Issue
Fixes #34
Fixes #35
Example
library (rdryad)
rdryad_cache <- rdryad::dryad_get_cache ()
rdryad_cache$cache_path_set (full_path = normalizePath ("~/Downloads/junk", mustWork = FALSE))
#> [1] "/home/me/Downloads/junk"
# mustWork = F because path does not (yet) exist
rdryad_cache$cache_path_get ()
#> [1] "/home/me/Downloads/junk"
rdryad_cache$mkdir()
rdryad::dryad_set_cache (rdryad_cache)
dryad_download(dois = "10.5061/dryad.f385721n")
#> $`10.5061/dryad.f385721n`
#> [1] "/home/me/Downloads/junk/10_5061_dryad_f385721n/Crossin et al 2012 MAC data for Dryad.csv"
#> [2] "/home/me/Downloads/junk/10_5061_dryad_f385721n/README_for_Crossin et al 2012 MAC data for Dryad.rtf"
Created on 2021-11-09 by the reprex package (v2.0.1.9000)
@sckott I presume you won't be looking at this, but ping nonetheless just in case. I'll give you a couple of days, otherwise i'll merge by end of week regardless.
Description
@trashbirdecology @krzbar Hi there, I've taken over maintenance of this package now. This PR implements an ability to specify the cache directory used by
rdryad
. Functionality demonstrated in thereprex
below.The previous version used the
.onLoad
linedryad_cache <<- <...>
. As well as the problems identified in #34, #35, that failed in many places anyway, notably including calls embedded within other processes or threads. This PR stores thehoardr
object specifying the cache inoptions()
, which are faithfully copied and passed between allcallr
processes, so this approach should be more robust.Related Issue
Fixes #34 Fixes #35
Example
Created on 2021-11-09 by the reprex package (v2.0.1.9000)