This function reads a data package downloaded with the function data_package_read() to the R environment as a list object.

data_package_read(
    data.pkg.path = NULL
  )

Arguments

data.pkg.path

(character) Directory where a data package stored. Default (NULL) is the temporary data package directory defined by paste0(tempdir(), 'data_package').

Value

(list) List of tibbles containing data and metadata. Each list object is named after the data object file name.

Details

This function is a wrapper to read_d1_files() function of the metajam package but outputs an object with a slightly different format.

Examples

# NOT RUN {
# Read data package from temporary directory -------------------------------

# Download data package to temporary directory
data_package_download(data.pkg.doi = 'doi:10.18739/A2DP3X')

# Read data package into R
pkg <- data_package_read()

# View data package contents
View(pkg)

# Clean up
data_package_remove()

# Read data package from local directory -----------------------------------

# Download data package to local directory
data_package_download(
  data.pkg.doi = 'doi:10.18739/A2DP3X',
  download.dir = '/Desktop/data_packages'
)

# Read data package into R
pkg <- data_package_read(
  data.pkg.path = '/Desktop/data_packages/AlSR200915'
)

# View data package contents
View(pkg)

# Clean up
data_package_remove('/Desktop/data_packages/AlSR200915')

# }