Learn R Programming

fImport (version 260.72)

Forecasts: Import Market Data from www.forecasts.org

Description

A collection and description of functions to import financial and economic market data from the www.forecast.org web site. The functions are: ll{ forecastsImport monthly data from the Financial Forecast Center, forecastsSeries easy to use download from Financial Forecast Center.}

Usage

forecastsImport(query, file = "tempfile", 
    source = "http://www.forecasts.org/data/data/", save = FALSE, 
    try = TRUE) 
      
forecastsSeries(query, returnClass = c("timeSeries", "ts", "matrix", 
    "data.frame"), getReturns = FALSE, ...)

Arguments

getReturns
a logical flag. Should return values be computed using the function returnSeries?
file
a character string with filename, usually having extension ".csv", where to save the downloaded data.
query
a character string, denoting the location of the data at the web site.
returnClass
a character string naming the class of the object to be returned. By default the function returns a "timeSeries" object, alternatives are: "ts", "matrix", or "data.frame".
save
a logical value, if set to TRUE the downloaded data file will be stored under the path and file name specified by the string file. By default FALSE.
source
a character string with the download URL.
try
a logical value, if set to TRUE the Internet access will be checked.
...
optional arguments to be passed.

Value

  • The function forecastsImport returns an S4 object of class fWEBDATA with the following slots:
  • @callthe function call.
  • @datathe data as downloaded formatted as a data.frame.
  • @parama character vector whose elements contain the values of selected parameters of the argument list.
  • @titlea character string with the name of the download. This can be overwritten specifying a user defined input argument.
  • @descriptiona character string with an optional user defined description. By default just the current date when the test was applied will be returned.
  • The function forecastsSeries returns an S4 object of class timeSeries or alternatively an object specified by the function argument returnClass.

Examples

Run this code
## forecastsImport -
   NA

Run the code above in your browser using DataLab