joshuaulrich / quantmod

Quantitative Financial Modelling Framework
http://www.quantmod.com/
GNU General Public License v3.0
814 stars 224 forks source link

mention quantmod in message from getSymbols #334

Closed GeoBosh closed 3 years ago

GeoBosh commented 3 years ago

Description

getSymbols() issues a message about switching the default of auto.assign=TRUE to FALSE from v0.5-0. But it doesn't mention that this is quantmod's version. This can be confusing if getSymbols is called from a function in another package. I encountered it with tseries::get.hist.quote (tseries' version is > 0.10).

Expected behavior

Not really a bug. It would be sufficient to add quantmod to the version: "... from quantmod v0.5-0...".

Minimal, reproducible example

library(tseries)
x <- get.hist.quote(instrument = "^gspc", start = "1998-01-01", quote = "Close")
## ‘getSymbols’ currently uses auto.assign=TRUE by default, but will
## use auto.assign=FALSE in 0.5-0. You will still be able to use
## ‘loadSymbols’ to automatically load data. getOption("getSymbols.env")
## and getOption("getSymbols.auto.assign") will still be checked for
## alternate defaults.

## This message is shown once per session and may be disabled by setting 
## options("getSymbols.warning4.0"=FALSE). See ?getSymbols for details.

## time series starts 1998-01-02
## time series ends   2021-06-04

Session Info

R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8    
 [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8   
 [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] tseries_0.10-48

loaded via a namespace (and not attached):
 [1] zoo_1.8-9       compiler_4.0.3  tools_4.0.3     xts_0.12.1     
 [5] curl_4.3.1      quantmod_0.4.18 grid_4.0.3      TTR_0.24.2     
 [9] lattice_0.20-44 quadprog_1.5-8 
joshuaulrich commented 3 years ago

Thanks for noticing this and the suggestion. I'm going to remove the message completely, because we've decided against changing the behavior of getSymbols() at this point. It would be too disruptive to existing code.

joshuaulrich commented 3 years ago

Done in d5f59f462121711449a5ef78727ecb541de325af, which will be included in the next release.