dataset: dataset for an Automated Data Observatory

Description Usage Arguments Details Value Examples

View source: R/dataset.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
dataset(
  x,
  dataset_code,
  dataset_title,
  freq,
  unit,
  unit_name,
  source = "greendeal.dataobservatory.eu",
  doi = NULL,
  add_obs_status = TRUE
)

is.dataset(x)

## S3 method for class 'dataset'
print(x, n = 10, ...)

## S3 method for class 'dataset'
summary(x, ...)

Arguments

x

A data frame

dataset_code

A unique dataset id code.

dataset_title

A title, which should be the main Title if there are several titles given by add_titles.

freq

A frequency variable coded with add_frequency.

unit

A standardized unit id.

unit_name

A unit name.

source

A source, currently defaults to "greendeal.dataobservatory.eu".

add_obs_status

Defaults to TRUE, when missing obs_status is added with add_observation_status.

n

The number of observations to print.

Details

The attributes of the dataset are

dataset_code

The dataset_code id.

Title

The title of the dataaset.

source

The data source information.

unit_name

The name of the unit variable, which is recorded by its id in the dataset.

sessionInfo

The session information added by add_sessioninfo.

Value

A validated dataset object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
my_dataset <- dataset (
     x =data.frame ( time = c(2019,2019,2020,2020),
                geo = c("BE", "BE", "NL", "NL"),
                value = c(10,11,NA,13)),
     dataset_code = "test_code",
     dataset_title = "Test dataset",
     freq = "A",
     unit = "NR", unit_name = "Number"
)
is.dataset(my_dataset)

print(my_dataset,5)

dataobservatory-eu/dataobservatory documentation built on Jan. 7, 2022, 8:55 p.m.