The dataset S3 class is an extension of the data frame and tibble class. It has some important metadata attributes that help the documentation of the dataset. Furthermore, it has an adequate print and summary method.

data("small_population")
small_population_dataset <- dataset (
  x= small_population,
  dataset_code = "small_population_total",
  dataset_title = "Population of Small European Countries",
  freq = "A",
  unit = "NR",
  unit_name = "number")

attributes (small_population_dataset)
#> $names
#> [1] "dataset_code" "time"         "geo"          "value"        "unit"        
#> [6] "obs_status"   "freq"        
#> 
#> $row.names
#>  [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#> 
#> $class
#> [1] "dataset"    "tbl_df"     "tbl"        "data.frame"
#> 
#> $dataset_code
#> [1] "small_population_total"
#> 
#> $Title
#> [1] "Population of Small European Countries"
#> 
#> $source
#> [1] "greendeal.dataobservatory.eu"
#> 
#> $unit_name
#> [1] "number"
#> 
#> $updated
#> [1] "2021-07-06"
#> 
#> $earliest_actual_observation
#> [1] "2009-01-01"
#> 
#> $latest_actual_observation
#> [1] "2020-01-01"
#> 
#> $sessionInfo
#> [1] "{\"platform\":[\"x86_64-w64-mingw32/x64 (64-bit)\"],\"locale\":[\"LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252\"],\"running\":[\"Windows 10 x64 (build 17763)\"],\"RNGkind\":[\"Mersenne-Twister\",\"Inversion\",\"Rejection\"],\"basePkgs\":[\"stats\",\"graphics\",\"grDevices\",\"utils\",\"datasets\",\"methods\",\"base\"],\"matprod\":[\"default\"],\"BLAS\":[\"\"],\"LAPACK\":[\"\"],\"system.codepage\":[\"1250\"],\"codepage\":[\"1252\"]}"
print(small_population_dataset)
#> Population of Small European Countries
#> dataset code:  small_population_total 
#> Actual observation range: [2009-01-01]-[2020-01-01], updated on 2021-07-06.
#> Geographic coverage:  LI, AD, SM 
#> The first 10 observations of 23 (unit: number):
#> 
#>              dataset_code       time geo value unit obs_status freq
#> 1  small_population_total 2020-01-01  LI 38747   NR          A    A
#> 2  small_population_total 2019-01-01  AD 76177   NR          A    A
#> 3  small_population_total 2019-01-01  LI 38378   NR          A    A
#> 4  small_population_total 2018-01-01  LI 38114   NR          A    A
#> 5  small_population_total 2018-01-01  SM 34453   NR          A    A
#> 6  small_population_total 2017-01-01  LI 37810   NR          A    A
#> 7  small_population_total 2016-01-01  LI 37622   NR          A    A
#> 8  small_population_total 2015-01-01  LI 37366   NR          A    A
#> 9  small_population_total 2014-01-01  LI 37129   NR          A    A
#> 10 small_population_total 2013-01-01  AD 76246   NR          A    A
#> 
#> Source: greendeal.dataobservatory.eu
summary(small_population_dataset)
#> Population of Small European Countries
#> dataset code:  small_population_total 
#> Actual observation range: [2009-01-01]-[2020-01-01], updated on 2021-07-06.
#> Geographic coverage:  LI, AD, SM 
#> 
#>       time                value      
#>  Min.   :2009-01-01   Min.   :31269  
#>  1st Qu.:2011-01-01   1st Qu.:35742  
#>  Median :2013-01-01   Median :37366  
#>  Mean   :2013-07-10   Mean   :47298  
#>  3rd Qu.:2016-07-02   3rd Qu.:57462  
#>  Max.   :2020-01-01   Max.   :84484  
#> Source: greendeal.dataobservatory.eu
is.dataset(small_population_dataset)
#> [1] TRUE

Adding Metadata

The descriptive metadata can be added with the datacite() constructor (see: ?datacite ) or the datacite_dataset() helper function, or read the DataCite Descriptive Metadata vignette article.

The statistical processing information can be added with the not fully implemented codebook class. Read the The codebook Class vignette article.