ods_dataset returns a dataset from statistics.gov.scot

ods_dataset(dataset, start_date = NULL, end_date = NULL,
  geography = NULL, ...)

Arguments

dataset

string. The identifying final part of a URI for a dataset on statistics.gov.scot.

start_date

string. Filter data points after this date.

end_date

string. Filter data points before this date.

geography

string. A valid SG geography code, or portion thereof.

...

Arbitrary filters requiring valid scheme = value structure.

Value

tibble. When invalid arguments are used returns NULL with warning (see ods_error_message).

Details

ods_dataset returns either a complete or filtered dataset from statistics.gov.scot. The dataset parameter must be passed a valid dataset name (a full list can be obtained by calling ods_all_datasets(). Other parameters can be used to filter the dataset.

Examples

ods_dataset("average-household-size")
#> Parsed with column specification: #> cols( #> FeatureCode = col_character(), #> DateCode = col_integer(), #> Measurement = col_character(), #> Units = col_character(), #> Value = col_double() #> )
#> # A tibble: 561 x 5 #> FeatureCode DateCode Measurement Units Value #> <chr> <int> <chr> <chr> <dbl> #> 1 S12000039 2015 Ratio People Per Household 2.09 #> 2 S12000039 2010 Ratio People Per Household 2.14 #> 3 S12000039 2005 Ratio People Per Household 2.21 #> 4 S12000039 2012 Ratio People Per Household 2.13 #> 5 S12000039 2007 Ratio People Per Household 2.18 #> 6 S12000039 2006 Ratio People Per Household 2.19 #> 7 S12000039 2001 Ratio People Per Household 2.27 #> 8 S12000039 2002 Ratio People Per Household 2.27 #> 9 S12000039 2016 Ratio People Per Household 2.09 #> 10 S12000039 2004 Ratio People Per Household 2.24 #> # ... with 551 more rows