TSdbiMethods: TSdbi Extensions to Wrap Several (in Development) Data...

Description Usage Arguments Details Value See Also Examples

Description

Get a time series (matrix) from a variety of source URLs

Usage

 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
26
    Quandl(...)

    ## S4 method for signature 'QuandlConnection,missing'
TSconnect(q, dbname,
               api_key=NULL, ...)
    ## S4 method for signature 'character,TSQuandlConnection'
TSget(serIDs, con, 
	TSrepresentation = getOption("TSrepresentation"), 
	tf = NULL, start = tfstart(tf), end = tfend(tf), names = NULL,
	quote = NULL, TSdescription = FALSE, TSdoc = FALSE, TSlabel=FALSE,
	TSsource=TRUE, vintage = NULL, ...)
    ## S4 method for signature 'character,TSQuandlConnection'
TSdates(serIDs, 
        con=getOption("TSconnection"), vintage=NULL, panel=NULL, ...)
    ## S4 method for signature 'character,TSQuandlConnection'
TSexists(serIDs, con,
           vintage=NULL, panel=NULL, ...)
    ## S4 method for signature 'character,TSQuandlConnection'
TSdescription(x, con, ...)
    ## S4 method for signature 'character,TSQuandlConnection'
TSdoc(x, 
                con=getOption("TSconnection"), ...)
    ## S4 method for signature 'character,TSQuandlConnection'
TSlabel(x, con, ...)
    ## S4 method for signature 'character,TSQuandlConnection'
TSsource(x, con, ...)

Arguments

q

A character string indicating the query interface to use, or a database connection object.

dbname

A character string indicating the name of the database to which the connection should be established, omitted if q is a database connection object. The string should be the first part of Quandl identifier code ( before '/', e.g. 'NSE').

con

A TSconnection object.

serIDs

identifiers for series to extract. (Second part of Quandl identifier code, after '/').

x

a series identifier for TSdescription and TSdoc or, for print, a database connection as returned by TSconnect.

api_key

character string of Quandl access api_key.

TSrepresentation

time series representation to use for the result.

names

Optional character vector to use for series names. Defaults to serIDs.

tf

Optional time frame to use for truncating data. (See tfwindow.)

start

Optional start date to use for truncating data.)

end

Optional end date to use for truncating data.)

TSdescription

TRUE or FALSE indicating whether description should be extracted

TSdoc

TRUE or FALSE indicating whether documentation should be extracted.

TSlabel

For compatibility with other TS packages. Not supported in Quandl

TSsource

If TRUE (default) TSsource in the result is set to "Quandl".

quote

reference item (e.g. ”Close”). See details.

vintage

Vintage to be supplied (if available on dbname).

panel

Panel to be supplied (if available).

...

Arguments passed to other methods.

Details

These are methods for TSdbi . See the package TSdbi for details and see the vignette distributed with the TSdata package for more complete examples.

Interfaces in this package are generally less stable or in development compared with other TS* packages.

The package provides a wrapper to the Quandl package to provide a TSdbi API for users. Function TSConnect sets the information used for the connection. TSget retrieves data. Both start and end can be either date objects or character strings.

The Quandl access api_key can be specified either as an argument to TSConnect (api_key="chars") or in a file .Quandl.cnf in the user's home directory, or in an environment variable 'QUANDL_API_KEY', or using the Quandl Quandl.api_key function. This last will require the user to attach Quandl in order to set it. The search will be done in that order and the first non-NULL value used. If no api_key is found then access will be tried without a api_key, but this will be subject to the limit imposed by Quandl.

The argument quote can be used to select a subset of the data requested, in the case of a multivariate dataset. For example, daily stock or stock index results may have columns "Open", "High", "Low", "Close", ... . The argument quote can be used to select from these. Note that when argument quote is specified to select a subset of the dataset requested, capitalization is important.

Value

depends.

See Also

TSdbi-package, TSconnect, TSdates, TSget, tfwindow, Quandl

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
 require("tfplot")
 ## Not run: 
  con <- TSconnect("Quandl", dbname="NSE")
  x  <- TSget("OIL", con, start="2001-01-01")
  start(x)
  end(x)
  
  x  <- TSget("OIL", con, start=as.Date("2001-01-01")) 
  tfplot(x)
  
  dimnames(x)[2]
  x <- TSget("OIL", con, quote="Open")

  tfplot(x)
  
## End(Not run)

TSmisc2 documentation built on May 2, 2019, 6:52 p.m.