datapack Background
adapted from the dataone and datapack vignettes
datapack
is written differently than most R packages you may have encountered in the past. This is because it uses the S4 system instead.
Data packages
Data packages are a class that has slots for relations
(provenance), objects
(the metadata and data file(s)) and systemMetadata
.
Data Objects
You can see what slots are in an S4 object after typing the subsetting operator @
, or pressing TAB with the cursor after an existing @
. Try viewing the slots of the data package.
Check out the objects
slot
The objects
slot contains a list of object PIDs that are accessed using the $
subsetting operator. Both are found within the structure of data packages in R.
Get the number for data and metadata files associated with this data package:
Get the file names and corresponding pids
Get identifiers
You can search by any of the sysmeta
slots such as fileName
and formatId
and get the corresponding identifier(s):
metadataId <- selectMember(dp, name="sysmeta@ADD THE NAME OF THE SLOT", value="PATTERN TO SEARCH BY")
Example: