joshuaulrich / quantmod

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

Warning Message #315

Closed giraljo closed 3 years ago

giraljo commented 3 years ago

Capture

Description

Warning message launched when R Studio starts:

Registered S3 method overwritten by 'quantmod': method from as.zoo.data.frame zoo

Expected behavior

N/A

Minimal, reproducible example

#N/A

Session Info

R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale:
[1] LC_COLLATE=Spanish_Colombia.1252  LC_CTYPE=Spanish_Colombia.1252   
[3] LC_MONETARY=Spanish_Colombia.1252 LC_NUMERIC=C                     
[5] LC_TIME=Spanish_Colombia.1252    

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

loaded via a namespace (and not attached):
 [1] zoo_1.8-8         minpack.lm_1.2-1  tidyselect_1.1.0  reshape2_1.4.4    purrr_0.3.4      
 [6] urca_1.3-0        haven_2.3.1       lattice_0.20-41   carData_3.0-4     colorspace_1.4-1 
[11] vctrs_0.3.1       generics_0.0.2    yaml_2.2.1        erer_3.0          rlang_0.4.6      
[16] pillar_1.4.4      foreign_0.8-80    glue_1.4.1        TTR_0.23-6        readxl_1.3.1     
[21] plyr_1.8.6        lifecycle_0.2.0   stringr_1.4.0     quantmod_0.4.17   munsell_0.5.0    
[26] gtable_0.3.0      cellranger_1.1.0  zip_2.0.4         systemfit_1.1-24  rio_0.5.16       
[31] forcats_0.5.0     tseries_0.10-47   lmtest_0.9-37     curl_4.3          xts_0.12-0       
[36] Rcpp_1.0.4.6      scales_1.1.1      abind_1.4-5       ggplot2_3.3.2     hms_0.5.3        
[41] stringi_1.4.6     openxlsx_4.1.5    dplyr_1.0.0       grid_4.0.2        quadprog_1.5-8   
[46] tools_4.0.2       sandwich_2.5-1    magrittr_1.5      tibble_3.0.1      crayon_1.3.4     
[51] car_3.0-8         pkgconfig_2.0.3   ellipsis_0.3.1    MASS_7.3-51.6     Matrix_1.2-18    
[56] data.table_1.12.8 rstudioapi_0.11   R6_2.4.1          nlme_3.1-148      compiler_4.0.2   
joshuaulrich commented 3 years ago

I started the process to deprecate quantmod::as.zoo.data.frame() in favor of zoo::as.zoo.data.frame() in July of 2019. I couldn't remove it immediately because the two methods have different behavior that may break existing code. I will remove it after July of 2021.

I'm closing because this has already been addressed.

R$ library(quantmod)
R$ data(sample_matrix)
R$ d <- as.data.frame(sample_matrix)
R$ z <- as.zoo(d)

NOTE: quantmod::as.zoo.data.frame() is deprecated
  Use as.zoo(x, order.by = as.Date(rownames(x))) instead.
  This note is printed once. To see it for every call, set
  options(quantmod.deprecate.as.zoo.data.frame = TRUE)
giraljo commented 3 years ago

Got it Thank you

stephenashton-dhsc commented 6 months ago

Apologies for commenting on a long-closed issue, but I was wondering if there was any progress on the removal of quantmod::as.zoo.data.frame()? I appreciate it's likely not a priority, but the 'S3 method overwriting' message is still appearing both here and in downstream packages.

joshuaulrich commented 6 months ago

@stephenashton-dhsc no worries! I forgot about this, so appreciate the nudge. I'll convert this to a warning/error now and create an issue to unregister the method in a future release.