add_metadata | R Documentation |
This can be used annually to update some 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.
add_metadata(x, metadata)
x |
dataset (or any object) whose metadata you want to update or create |
metadata |
must be a named list, so that the function can do this for each i: attr(x, which=names(metadata)[i]) <- metadata[[i]] |
returns x but with new or altered attributes
x <- data.frame(a=1:10,b=1001:1010)
metadata <- list(
census_version = 2020,
acs_version = '2016-2020',
acs_releasedate = '3/17/2022',
ejscreen_version = '2.1',
ejscreen_releasedate = 'October 2022',
ejscreen_pkg_data = 'bg22'
)
x <- add_metadata(x, metadata)
attributes(x)
x <- add_metadata(x, list(status='final'))
attr(x,'status')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.