tidy_table_as_zoo {blsR}R Documentation

Convert a single series or n series tables into a zoo object

Description

Convert a single series or n series tables into a zoo object

Usage

tidy_table_as_zoo(table, index_function = .zoo_index_function)

Arguments

table

a table of results

index_function

optional closure. The closure argument is the table and it should return a vector of values compatible with a zoo index. The default function will return a vector of zoo::yearmon() for monthly series and zoo::yearqtr() for quarterly or annual series.

Details

A utility function to easily convert retrieved BLS series into zoo or xts objects.

Value

a zooobject

See Also

Other blsR-utils: bls-api-key, data_as_table(), data_as_tidy_table(), merge_tables(), merge_tidy_tables(), reduce_spanned_responses(), span_request_queries(), span_series_request(), tidy_periods()

Examples

## Not run: 
series <- get_series('LNS14000001')
table <- data_as_tidy_table(series$data)
zoo_obj <- tidy_table_as_zoo(table)

## End(Not run)

[Package blsR version 0.5.0 Index]