openPolandFilter: Filter a dataset from openPoland API.

Description Usage Arguments Value See Also Examples

Description

openPolandFilter filter a dataset with given criterias and returns a data frame.

Usage

1
2
openPolandFilter(data = NULL, nts = NULL, unit = NULL, year = NULL,
  name = NULL)

Arguments

data

A data table that is a result of openPolandData function.

nts

A character string. Of length one to indicate the level or of length 10 to search for a specific NTS id of territorial unit.

unit

A character string of predefined values: "region", "voivodship", "subregion", "powiat", "gmina".

year

A numeric value or character string.

name

A character string.

Value

A data table object. The first column is a NTS id of territorial unit. The second column is a common name of territorial unit. Then there are from 1 to 5 columns with dimensions labels. All dimensions in a given dataset can be previewed by the openPolandMeta function. Last four columns of the data table are: year, measure unit, value and data attribute.

See Also

openPolandData for downloading a selected dataset via openPoland API, openPolandMeta for getting meta information about datasets, and openPolandSearch for searching database with a given query.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Not run: 

# token for API authorization
token = "[alpha-numeric-string-you-get-after-registration-on-https://openpoland.net]"

openPolandMeta(id =  1944, token = token)

# a whole, unfiltered dataset
data = openPolandData(id = 1944, token = token)

unique(openPolandFilter(data = data, unit="region")$name)
unique(openPolandFilter(data = data, unit="voivodship")$name)
unique(openPolandFilter(data = data, unit="subregion")$name)
unique(openPolandFilter(data = data, unit="powiat")$name)
unique(openPolandFilter(data = data, unit="gmina")$name)

unique(openPolandFilter(data = data, nts=5)$name)

openPolandFilter(data = data, name="Warszawa")
openPolandFilter(data = data, nts='3265301032')
openPolandFilter(data = data, nts='3265301032', year=2010)


## End(Not run)

kalimu/openPoland documentation built on May 20, 2019, 6:32 a.m.