Open wibeasley opened 4 years ago
I like the idea a lot -- it would both simplify coding in the package but also make it much easier to use functionality unsupported by the client (my linked use case).
Two comments on the above:
kernel
-- not sure that's a very intuitive label in this case. How about mirroring pyDataverse and doing get_request()
and post_request()
Anything that functionalizes all that paste
duplication would be great for me! I agree that kernel
is an uninformative name for my background. What @adam3smith suggests sounds better, or at least I'd like to know the definition of kernel in this context.
@adam3smith wrote in https://github.com/IQSS/dataverse-client-r/issues/49#issuecomment-579343318
We encountered something similar in REDCapR. It's a similar package as this one --in the sense that it's basically a glove around curl calls to a server's api. Then it adds to convenience functions and validation to make R development easier because it returns R's native
data.frame
objects.When we saw all the duplication in REDCapR, we refactored that core functionality into
kernel_api()
. That central location makes it easier to improve things consistently like character encoding and error handling. It returns raw result to the calling function, which decides whether to save it as a local file, or return a data.frame.In
dataverse::get_file()
, I see the replication @adam3smith's talking about, with three instances similar toThis could become its own function like
The code inside [
dataverse::get_file_metadata()
]() would look likeThe code inside the current
dataverse::get_file()
would have three different calls:@adam3smith, @kuriwaki, or anyone else, please share your impressions if you'd like. It looks like @skasberger and the pyDataverse do something very similar with their
get_request()