Attributes of a dataset
Arguments
- x
A data.frame or inherited tibble, data.frame, or a structured list.
- sdmx_attributes
The optional SDMX dimensions.
- value
The name or column number of the within the dataset.
Value
A data frame of the names, class, isDefinedBy, and codeList properties of the attributes columns of a dataset following the datacube model.
Details
Do not confuse with base::attributes
, which applies to the attributes
of the entire dataset, and not each observation (measurement) row.
See the W3C and SDMX definition of a attribute.
Examples
df <- data.frame ( sex = c("M", "F"), value = c(1,2), unit = c("NR", "NR"))
dimensions(df, sdmx_attributes = "sex") <- "sex"
measures(df) <- "value"
attributes_measures(df) <- "unit"
attributes_measures(df)
#> names class
#> unit unit character
#> isDefinedBy
#> unit https://purl.org/linked-data/cube|https://raw.githubusercontent.com/UKGovLD/publishing-statistical-data/master/specs/src/main/vocab/sdmx-attribute.ttl
#> codeListe
#> unit not yet defined