Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

getSymbols.csv

Load Data from csv File


Description

Downloads Symbols to specified env from local comma seperated file. This method is not to be called directly, instead a call to getSymbols(Symbols,src='csv') will in turn call this method. It is documented for the sole purpose of highlighting the arguments accepted, and to serve as a guide to creating additional getSymbols ‘methods’.

Usage

getSymbols.csv(Symbols,
                 env,
                 dir="",
                 return.class = "xts",
                 extension="csv",
                 col.names=c("Open","High","Low","Close","Volume","Adjusted"),
                  ...)

Arguments

Symbols

a character vector specifying the names of each symbol to be loaded

env

where to create objects. (.GlobalEnv)

dir

directory of csv file

return.class

class of returned object

extension

extension of csv file

col.names

data column names

...

additional parameters

Details

Meant to be called internally by getSymbols (see also).

One of a few currently defined methods for loading data for use with quantmod. Essentially a simple wrapper to the underlying R read.csv.

Value

A call to getSymbols.csv will load into the specified environment one object for each Symbol specified, with class defined by return.class. Presently this may be ts, zoo, xts, or timeSeries.

Note

This has yet to be tested on a windows platform. It should work though file seperators may be an issue.

Author(s)

Jeffrey A. Ryan

See Also

Examples

## Not run: 
# All 3 getSymbols calls return the same
# MSFT to the global environment
# The last example is what NOT to do!

## Method #1
getSymbols('MSFT',src='csv')


## Method #2
setDefaults(getSymbols,src='csv')
  # OR
setSymbolLookup(MSFT='csv')

getSymbols('MSFT')

#########################################
##  NOT RECOMMENDED!!!
#########################################
## Method #3
getSymbols.csv('MSFT',verbose=TRUE,env=globalenv())

## End(Not run)

quantmod

Quantitative Financial Modelling Framework

v0.4.18
GPL-3
Authors
Jeffrey A. Ryan [aut, cph], Joshua M. Ulrich [cre, aut], Wouter Thielen [ctb], Paul Teetor [ctb], Steve Bronder [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.