Skip to contents

Returns source values separately from numeric observations. Unknown source symbols are preserved without assigning them an undocumented meaning. Status is "observed" for finite numbers, "missing" for empty or missing values, and "symbol" for other source text, including non-finite numbers. Save this table alongside transformed or exported data because ordinary transformations may discard attributes.

Usage

nso_value_status(x)

Arguments

x

A result from nso_data(), nso_fetch(), nso_package(), or nso_portal_data().

Value

A tibble containing observation keys, value_raw, and value_status, or an empty tibble if source status was not retained.

Examples

# Constructed records illustrate numeric values and an unresolved symbol.
observations <- data.frame(
  period = c("2023", "2024"),
  value = c(12, NA_real_),
  value_raw = c("12", ".."),
  value_status = c("observed", "symbol")
)
nso_value_status(observations)
#> # A tibble: 2 × 4
#>   period value value_raw value_status
#>   <chr>  <dbl> <chr>     <chr>       
#> 1 2023      12 12        observed    
#> 2 2024      NA ..        symbol      

# Ordinary data without retained status have no source-value records.
nso_value_status(data.frame(value = 12))
#> # A tibble: 0 × 0