indicator: Indicator for an Automated Data Observatory

Description Usage Arguments Value Examples

View source: R/indicator.R

Description

The class inherits all methods from a data frame, but has many fixed attributes.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
indicator(
  x,
  shortcode,
  indicator_code = NULL,
  indicator_name = NULL,
  description,
  description_at_source = NA_character_,
  last_update_data = NULL,
  date_earliest = NULL,
  date_latest = NULL,
  original_source = NA_character_,
  code_at_source = NULL,
  doi = NULL,
  keyword1,
  keyword2,
  keyword3,
  keyword4,
  keywords = NA_character_
)

is.indicator(x)

## S3 method for class 'indicator'
print(x, ...)

Arguments

x

A data.frame or tibble with at least geo, time, value, and estimate columns.

shortcode

A short, unique, programatically usable, memorizable indicator ID, given by an observatory curator.

indicator_code

A machine-generated code. If there is no machine-generated code present, it is filled with shortcode.

indicator_name

A unique name for the indicator.

description

A precise character string describing the indicator for the data catalogue of the data observatory.

description_at_source

A machine read description from the source, may require manual revision.

last_update_data

The creation/refreshment date of the indicator. If omitted, calls Sys.Date().

date_earliest

The date of the earliest observation. Can be a numeric containing a year.

date_latest

The date of the latest observation.

original_source

Defaults to NA_character_.

code_at_source

The identifier in the original source, if applicable.

doi

A document object identifier, if exists.

keyword1

The first keywords must be on of the observatories: economy, greendeal, music and planned ones: competition, creative.

keyword2

The second keyword must be one of the pillars of the observatory.

keyword3

The third must be a topic within a pillar.

keyword4

A search term within the topic.

keywords

A character vector of any optional, further keywords.

Value

A data.frame or tibble with indicator attributes.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
test_indicator <- indicator (
                     x <- data.frame (
                     geo = rep(c("NL", "BE", "LU"), 4),
                     time = rep(c(2016:2019),3),
                     value = runif(12, 1,100),
                     estimate = rep("actual", 12)
                     ),
   shortcode = "observatory_test_1",
   description = "A test indicator with random numbers",
   last_update_data = as.Date ( "2020-08-24"),
   date_earliest  = min (x$time, na.rm=TRUE),
   date_latest  =  max(x$time, na.rm=TRUE),
   keyword1 = "music",  keyword2 = "economy",  keyword3 = "demand", keyword4="pcr"
)

## Only the first 10 observations are printed
print (test_indicator)

dataobservatory-eu/indicator documentation built on Dec. 19, 2021, 8:13 p.m.