Note: This vignette is illustrated with fake data. The dataset explored in this example should not be used to inform decision-making.
ready4use includes a number of tools for sharing health economic model data that forms part of the ready4 framework.
Identify data to be shared
To illustrate how to share data using ready4use
classes
and methods, we will first need some data to publish. In this example,
we are going to share X
, a Ready4useDyad
(a data
structure explained in another vignette) that we can create using data ingested
from an online repository.
objects_ls <- ingest(Ready4useRepos(dv_nm_1L_chr = "fakes",
dv_ds_nm_1L_chr = "https://doi.org/10.7910/DVN/HJXYKQ",
dv_server_1L_chr = "dataverse.harvard.edu",
gh_repo_1L_chr = "ready4-dev/ready4",
gh_tag_1L_chr = "Documentation_0.0"),
fls_to_ingest_chr = c("ymh_clinical_tb","ymh_clinical_dict_r3"),
metadata_1L_lgl = F)
X <- Ready4useDyad(ds_tb = objects_ls$ymh_clinical_tb,
dictionary_r3 = objects_ls$ymh_clinical_dict_r3) %>%
renew()
Share data
We now specify where we plan to publish X
in
Y
, a Ready4useRepos
object (described in
another vignette). Note, you must have write permissions to the
repositories you specify in this step. The values entered in this
example (the https://doi.org/10.7910/DVN/W95KED dataset from the fakes dataverse
will not work for you).
Y <- Ready4useRepos(dv_nm_1L_chr = "fakes", # Replace with values for a dataverse & dataset for which
dv_ds_nm_1L_chr = "https://doi.org/10.7910/DVN/W95KED", # you have write permissions.
dv_server_1L_chr = "dataverse.harvard.edu")
We can now upload X
to our preferred data repository
using the share
method. By default, if more than one data
repository was specified in Y
, then the dataverse
repository will be preferred when sharing. We can overwrite this default
by passing either “prefer_gh” or “all” values to the
type_1L_chr
argument. The Ready4useDyad object is now
available for download at https://doi.org/10.7910/DVN/W95KED.
Y <- share(Y,
obj_to_share_xx = X,
fl_nm_1L_chr = "ymh_clinical_dyad_r4",
description_1L_chr = "An example of a Ready4useDyad - a dataset (clinical youth mental health, AQoL-6D) and data dictionary pair. Note this example uses fake data.")