search_eurostat_dsd: Search the downloaded Data Structure Definition of a dataset

Description Usage Arguments Details Value See Also Examples

View source: R/search_eurostat_dsd.R

Description

Search the Data Structure Definition (DSD) of a Eurostat dataset for a given pattern. It returns the rows where the pattern appears in the code and name column of the output of the get_eurostat_dsd function.

Usage

1
search_eurostat_dsd(pattern, dsd = NULL, name = TRUE, ...)

Arguments

pattern

a character string or a vector of character string.

dsd

a table with the character string with the id of the dataset.

name

a boolean with the default value TRUE, if the search shall look for the pattern in the name of the code. If the value FALSE, then only the 'code' column of the DSD will be searched.

...

additional arguments to the grep fuynction like ignore.case=TRUE if the pattern should be searched case sensitive or not. The default value for ignore.case is FALSE.

Details

The function returns the line(s) where the searched pattern appears in the code or in the name column.

Value

If the pattern found then the function returns table with the 4 columns:

pattern The pattern which was searched
concept The name of the concepts in the data structure
code The list of codes where the pattern was found, or the code of a name where the pattern appears
name The name/description of the code where the pattern found, or the name of the code where the pattern appears

Otherwise returns the value FALSE.

See Also

get_eurostat_dsd, search_eurostat_toc.

Examples

1
2
3
4
dsd_example<-get_eurostat_dsd("nama_10_gdp",verbose=TRUE)
search_eurostat_dsd("EU",dsd_example)
search_eurostat_dsd("EU",dsd_example,ignore.case=TRUE)
search_eurostat_dsd("EU",dsd_example,name=FALSE)

restatapi documentation built on July 24, 2019, 1:05 a.m.