subset.tsdl: Subset of time series from the Time Series Data Library

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/subset.R

Description

subset.tsdl returns a subset of the time series data from the Time Series Data Library. Subsets can be for specific periods, or specific types of data or both.

Usage

1
2
## S3 method for class 'tsdl'
subset(x, cond1, cond2, ...)

Arguments

x

TSDL data or a subset of TSDL data

cond1, cond2

Optional conditions specifying subject (type) or frequency of the data. Character variable would be recognised as subject and numeric variable would be recognised as frequency. Positions are interchangeable.

...

Other arguments specifying conditions for where to search and what to search.

start

Numeric variable specifying starting year of the series.

description

String to be matched in the description attribute of the time series.

source

String to be matched in the source attribute of the time series.

Details

See unique(meta_tsdl$frequency) for possible values for cond1 and cond2 denoting frequency.

See unique(meta_tsdl$subject) for possible values for cond1 and cond2 denoting subject.

Partial matching used for both conditions.

Value

An object of class tsdl consisting of the selected series.

Author(s)

Yangzhuoran Yang

See Also

tsdl

meta_tsdl

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# Subset by frequency
tsdl_quarterly <- subset(tsdl,4)
tsdl_quarterly

# Subset by frequency and subject
tsdl_daily_industry <- subset(tsdl,12,"Industry")
tsdl_daily_industry

# Subset by source
tsdl_abs <- subset(tsdl, source = "Australian Bureau of Statistics")
tsdl_abs

# Subset by starting year
tsdl_1948 <- subset(tsdl, start = 1948)
tsdl_1948

# Subset by description
tsdl_nettraffic <- subset(tsdl, description = "Internet traffic")
tsdl_nettraffic

FinYang/tsdl documentation built on July 16, 2020, 11:03 p.m.