helper function for package to set metadata attributes of a dataset
Source:R/utils_metadata_add.R
metadata_add.Rd
Together with the metadata_mapping script, this can be used annually to update the metadata for datasets in a package. It just makes it easier to set a few metadata attributes similarly for a number of data elements, for example, to add new or update existing attributes.
Details
This utility would be used in scripts in EJAM/data-raw/ to add metadata to objects like x before use_data(x, overwrite=T)
Examples
# metadata_check() # internal function
x <- data.frame(a=1:10,b=1001:1010)
# x <- metadata_add(x) # internal function
attributes(x)
#> $names
#> [1] "a" "b"
#>
#> $class
#> [1] "data.frame"
#>
#> $row.names
#> [1] 1 2 3 4 5 6 7 8 9 10
#>