Learn R Programming

dvn (version 0.3.5)

dvAddFile: Add a study file

Description

Use Data Deposit API to add a file to a study.

Usage

dvAddFile( objectid, filename=NULL, dataframe=NULL, category=NULL, dv=getOption('dvn'), user=getOption('dvn.user'), pwd=getOption('dvn.pwd'), browser=FALSE, ...)

Arguments

objectid
Either a character string containing the id for a dataverse study (a handle) or an object of class “dvStudyAtom”. This could be returned from dvUserStudies (or, dvSearch, from the Data Sharing API).
filename
The path to a .zip file to be uploaded, or a vector of filenames (or paths) that will be compressed then uploaded.
dataframe
A character string (or vector of character strings) containing the names of dataframe(s) to be saved and uploaded. Files are named by their R object names, so a dataframe called df will become “df.RData”.
category
An optional character string containing a category to be used in uploading the files to Dataverse. For example, “Data” or “Codebook”. This can be used to organize files in the web browser interface. Must be valid as a path on the local OS, so it should not contain slashes or most other punctuation. If NULL, the default is “Files”.
dv
An optional character string specifying the Dataverse to query. Default is the Harvard IQSS Dataverse.
user
A character string containing a dataverse username. Default is options('dvn.user').
pwd
A character string containing the corresponding dataverse password. Default is options('dvn.pwd').
browser
A logical specifying whether the query should be executed in a web browser. Default is FALSE.
...
Optionally, additional arguments passed to curlPerform via dvDepositQuery.

Value

bibliographicCitation
A full citation for the study, compiled from metadata.
generator
A vector containing details about the SWORD application.
id
The full URI for the study.
objectId
The objectId for the study.
xml
A character string containing an XML data structure that includes a study citation and handle.

Details

This send a (.zip) file to a study, decompresses it, and adds the file contents to the study. To send multiple files, specify them as a character vector in filename. It is also possible to add one or more dataframes (in addition to or instead) of filenames.

The user should receive (immediately) an email from Dataverse confirming whether or not decompression of the .zip was successful. Successful file upload can also be checked with a call to dvStudyStatement.

Note: Filenames in the .zip must be unique and cannot duplicate the names of any files already attached to the study. Use dvDeleteFile to remove previous files and then replace by uploading a new .zip.

See Also

dvDeleteFile dvCreateStudy dvEditStudy dvReleaseStudy