Learn R Programming

TSsdmx (version 2016.8-1)

hasData: Functions to Check a Returned Time Series Data Object

Description

Check a time series (matrix) for returned data and metadata.

Usage

hasData(x, quiet=FALSE) hasDataCount(x) hasDataNames(x) hasDataDescriptions(x)

Arguments

x
A time series (matrix) as returned by TSget using an sdmx connection.
quiet
Suppress warnings and just return the logical result.

Value

Details

These functions check data returnded from SDMX databases such as Eurostat to verify if data and metadata has been returned by a query specification. This is a useful check because wildcard specifications may often result in no data being returned.

hasData returns a logical vector, one element for each series in x, indication TRUE if there is numeric data in that series or FALSE if all the data in the series is NA or NaN. If quiet=FALSE (the default) then a warning is issued for each series that has completely missing data.

hasDataCount prints a count of the number of series with actual data, and returns the number (invisibly).

hasDataNames returns the names of series with actual data.

hasDataDescriptions returns the descriptions of series with actual data.

See Also

TSget

Examples

Run this code
  ## Not run: 
#   require("TSsdmx")
#   eurostat <- TSconnect("sdmx", dbname="EUROSTAT")
# 
#   # 28 series, 23 with data
#   z <-  TSget("ei_nama_q.Q.MIO-EUR.NSA.CP.*.IT", eurostat) 
# 
#   sum(hasData(z, quiet=TRUE)) 
# 
#   hasDataCount(z)
#   hasDataNames(z)
# 
#   hasDataDescriptions(z)
#   ## End(Not run)

Run the code above in your browser using DataLab