New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getSymbols.google misses args changed by setSymbolLookup #138

Closed
joshuaulrich opened this Issue Jan 30, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@joshuaulrich
Owner

joshuaulrich commented Jan 30, 2017

It appears getSymbols.google only checks for symbol/name remappings. It doesn't check for user-specified defaults for any other formal arguments like getSymbols.yahoo does. getSymbols.google has the same formal arguments as getSymbols.yahoo, save index.class.

R> # set data source to Google, and first date to 2016-01-01
R> setSymbolLookup(MSFT = list(src = "google", from = "2016-01-01"))
R> # returned data still start in 2007, even though default is 2016-01-01
R> str(getSymbols("MSFT", auto.assign = FALSE))
An 'xts' object on 2007-01-03/2017-01-27 containing:
  Data: num [1:2535, 1:5] 29.9 29.7 29.6 29.6 30 ...
 - attr(*, "dimnames")=List of 2
  ..$ : NULL
  ..$ : chr [1:5] "MSFT.Open" "MSFT.High" "MSFT.Low" "MSFT.Close" ...
  Indexed by objects of class: [Date] TZ: UTC
  xts Attributes:  
List of 2
 $ src    : chr "google"
 $ updated: POSIXct[1:1], format: "2017-01-29 21:10:44"
R>
R> # set data source to Yahoo, and first date to 2016-01-01
R> setSymbolLookup(MSFT = list(src = "yahoo", from = "2016-01-01"))
R> # returned data start in 2016
R> str(getSymbols("MSFT", auto.assign = FALSE))
An 'xts' object on 2016-01-04/2017-01-27 containing:
  Data: num [1:270, 1:6] 54.3 54.9 54.3 52.7 52.4 ...
 - attr(*, "dimnames")=List of 2
  ..$ : NULL
  ..$ : chr [1:6] "MSFT.Open" "MSFT.High" "MSFT.Low" "MSFT.Close" ...
  Indexed by objects of class: [Date] TZ: UTC
  xts Attributes:  
List of 2
 $ src    : chr "yahoo"
 $ updated: POSIXct[1:1], format: "2017-01-29 21:10:51"

@joshuaulrich joshuaulrich added the bug label Jan 30, 2017

@joshuaulrich joshuaulrich self-assigned this Jan 30, 2017

@joshuaulrich joshuaulrich added this to the Release 0.4-8 milestone Apr 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment