Closed kuriwaki closed 6 months ago
@Danny-dK's proposal is more concise:
get_dataframe_by_doi(
filedoi = "10.70122/FK2/PPIAXE/X2FC5V",
server = "demo.dataverse.org",
original = TRUE,
.f = function(x) load(x, envir = .GlobalEnv))
I have made this change in dev: f33e578217547f5f465bdb5f50d2b347df4fa18a
Implemented in 0.3.14
RData files cannot be read in as an object, but instead are simply released on to the user environment. I think we should all be switching to Rds (see https://github.com/IQSS/dataverse/issues/7249) but nonetheless, some files on Dataverse are uploaded as .RData.
It turns out there are two ways to load this. One is the old way to write the binary file and re-read it with a different function. Another is to create a mini environment within a function, as I found on Stack Overflow. See both in the reprex below. I get identical objects.
We should update the doc with an example.
h/t @jonrobinson2
Created on 2021-09-16 by the reprex package (v2.0.1)