FinancialInstrument (version 1.3.1)

saveSymbols.days: Save data to disk

Description

Save data to disk the way that getSymbols.FI expects it to be saved.

Usage

saveSymbols.days(Symbols, base_dir = "", extension = "rda",
  env = .GlobalEnv)

saveSymbols.common(Symbols, base_dir = "", extension = "rda", env = .GlobalEnv)

Arguments

Symbols

character vector of names of objects to be saved

base_dir

character. directory in which to store data.

extension

file extension (“rda”)

env

environment that holds the data to be saved (.GlobalEnv by default)

Value

called for side-effect.

Details

If they do not already exist, subdirectories will be created for each of the Symbols. saveSymbols.common will save a single ‘rda’ file for each of the Symbols in that symbol's subdirectory. saveSymbols.days will split the data up into days and save a separate ‘rda’ file for each day in that symbol's subdirectory.

See Also

getSymbols.FI

Examples

Run this code
# NOT RUN {
getSymbols("SPY", src='yahoo')
dir.create("tmpdata")
saveSymbols.common("SPY", base_dir="tmpdata")
rm("SPY")
getSymbols("SPY", src='FI', dir="tmpdata", split_method='common')
unlink("tmpdata/SPY", recursive=TRUE)
# }

Run the code above in your browser using DataCamp Workspace