IQSS / dataverse-client-r

R Client for Dataverse Repositories
https://iqss.github.io/dataverse-client-r
61 stars 24 forks source link

Reorganize get_file functions and add a get_dataframe functions #66

Closed kuriwaki closed 3 years ago

kuriwaki commented 3 years ago

Resolves #48. This PR creates several functions to make it easier to load datasets by multiple inputs. It implements #35 and fixes #33.

See the README data download section in this branch for some examples. I have also edited the man pages of get_file_* and get_dataframe_* with more examples.

Internally the main internal function is a new get_file_by_id. The original workhorse get_file now calls get_file_by_id internally. Also, get_*_by_doi and get_*_by_name eventually call get_file_by_id.

To fix #33, an important distinction is whether or not a file is "ingested" or not (https://github.com/IQSS/dataverse-client-r/issues/33#issuecomment-563446164). My best attempt to get this test, only based on file ID, is to check if get_file_metadata returns something or errors out. There is probably a better way.