hasData: Functions to Check a Returned Time Series Data Object

Description Usage Arguments Details Value See Also Examples

Description

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

Usage

1
2
3
4
5
6
    hasData(x, quiet=FALSE) 
    hasDataCount(x) 
    hasDataNames(x) 
    hasDataDescriptions(x) 
    
    hasDataCodes(providor, flow, template, wild, gp=NULL)

Arguments

x

A time series (matrix) as returned by TSget using an sdmx connection.

quiet

Suppress warnings and just return the logical result.

providor

An SDMX data provider.

flow

A database (flow) at the provider.

template

Indicates code specifications for dimension fields not examined.

wild

The dimesion which is examined.

gp

Optional vector of strings uses via grep to narrow result.

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.

hasDataCodes returns the descriptions of series that actually return data from the query constructed with providor, flow, and template.

Value

Depends.

See Also

TSget

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
25
  ## Not run: 
  require("TSsdmx")
  eurostat <- TSconnect("sdmx", dbname="EUROSTAT")

  # 28 series, sometimes only 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)
  
  hasDataCodes( providor='INSEE', flow='CNT-2010-CSI-EMP',
              template='*.EMP', wild='SECT-INST')

  hasDataCodes( providor='IMF2',  flow='DS-BOP',
              template='A.MX.*', wild='INDICATOR')

  hasDataCodes( providor='IMF2',  flow='DS-BOP', 
              template='A.MX.*', wild='INDICATOR', gp= c('Current Account', 'Total'))

  
## End(Not run)

TSsdmx documentation built on May 2, 2019, 5:26 p.m.

Related to hasData in TSsdmx...