-
-
Notifications
You must be signed in to change notification settings - Fork 228
Closed
Description
Description
When calling getDividends only part of historical data about dividends is returned.
Expected behavior
All dividends for particular symbol should be returned.
Minimal, reproducible example
R version 4.2.2 Patched (2022-11-10 r83330) -- "Innocent and Trusting"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(quantmod)
Loading required package: xts
Loading required package: zoo
Attaching package: ‘zoo’
The following objects are masked from ‘package:base’:
as.Date, as.Date.numeric
################################### WARNING ###################################
# We noticed you have dplyr installed. The dplyr lag() function breaks how #
# base R's lag() function is supposed to work, which breaks lag(my_xts). #
# #
# If you call library(dplyr) later in this session, then calls to lag(my_xts) #
# that you enter or source() into this session won't work correctly. #
# #
# All package code is unaffected because it is protected by the R namespace #
# mechanism. #
# #
# Set `options(xts.warn_dplyr_breaks_lag = FALSE)` to suppress this warning. #
# #
# You can use stats::lag() to make sure you're not using dplyr::lag(), or you #
# can add conflictRules('dplyr', exclude = 'lag') to your .Rprofile to stop #
# dplyr from breaking base R's lag() function. #
################################### WARNING ###################################
Loading required package: TTR
Registered S3 method overwritten by 'quantmod':
method from
as.zoo.data.frame zoo
>
> GSY <- getSymbols("GSY", from="1990-01-01", auto.assign=FALSE)
> GSY.dividends <- getDividends("GSY")
> print(GSY.dividends)
GSY.div
2008-03-25 0.135
2008-04-24 0.085
2008-05-23 0.078
2008-06-24 0.081
2008-07-25 0.077
2008-08-25 0.073
2008-09-24 0.081
2008-10-27 0.080
2008-11-21 0.048
2008-12-24 0.168
2009-01-26 0.031
2009-02-23 0.023
2009-03-25 0.017
2009-04-24 0.017
2009-05-22 0.014
2009-06-24 0.011
2009-07-27 0.005
2009-08-25 0.003
2009-09-24 0.001
2010-12-27 0.005
2011-07-01 0.005
2011-08-01 0.018
2011-09-01 0.024
2011-10-03 0.022
2011-11-01 0.025
2011-12-01 0.024
2011-12-28 0.039
2012-02-01 0.010
2012-03-01 0.005
2012-04-02 0.014
2012-05-01 0.017
2012-06-01 0.018
2012-07-02 0.019
2012-08-01 0.019
2012-09-04 0.020
2012-10-01 0.026
2012-11-01 0.038
2012-12-03 0.055
2012-12-27 0.117
2013-02-01 0.042
2013-03-01 0.056
2013-04-01 0.051
2013-05-01 0.055
2013-06-03 0.047
2013-07-01 0.039
2013-08-01 0.042
2013-09-03 0.038
2013-10-01 0.037
2013-11-01 0.042
2013-12-02 0.039
2013-12-27 0.091
2014-02-03 0.032
2014-03-03 0.033
2014-04-01 0.041
2014-05-01 0.036
2014-06-02 0.046
2014-07-01 0.047
2014-08-01 0.048
2014-09-02 0.044
2014-10-01 0.044
2023-02-21 0.141
> dput(GSY.dividends)
structure(c(0.135, 0.085, 0.078, 0.081, 0.077, 0.073, 0.081,
0.08, 0.048, 0.168, 0.031, 0.023, 0.017, 0.017, 0.014, 0.011,
0.005, 0.003, 0.001, 0.005, 0.005, 0.018, 0.024, 0.022, 0.025,
0.024, 0.039, 0.01, 0.005, 0.014, 0.017, 0.018, 0.019, 0.019,
0.02, 0.026, 0.038, 0.055, 0.117, 0.042, 0.056, 0.051, 0.055,
0.047, 0.039, 0.042, 0.038, 0.037, 0.042, 0.039, 0.091, 0.032,
0.033, 0.041, 0.036, 0.046, 0.047, 0.048, 0.044, 0.044, 0.141
), class = c("xts", "zoo"), dim = c(61L, 1L), index = structure(c(1206403200,
1208995200, 1211500800, 1214265600, 1216944000, 1219622400, 1222214400,
1225065600, 1227225600, 1230076800, 1232928000, 1235347200, 1237939200,
1240531200, 1242950400, 1245801600, 1248652800, 1251158400, 1253750400,
1293408000, 1309478400, 1312156800, 1314835200, 1317600000, 1320105600,
1322697600, 1325030400, 1328054400, 1330560000, 1333324800, 1335830400,
1338508800, 1341187200, 1343779200, 1346716800, 1349049600, 1351728000,
1354492800, 1356566400, 1359676800, 1362096000, 1364774400, 1367366400,
1370217600, 1372636800, 1375315200, 1378166400, 1380585600, 1383264000,
1385942400, 1388102400, 1391385600, 1393804800, 1396310400, 1398902400,
1401667200, 1404172800, 1406851200, 1409616000, 1412121600, 1676937600
), tzone = "UTC", tclass = "Date"), dimnames = list(NULL, "GSY.div"))
> GSY.dividends <- getDividends("GSY", from="2022-01-01")
> print(GSY.dividends)
GSY.div
2022-01-24 0.020
2022-02-22 0.020
2022-03-21 0.023
2022-04-18 0.029
2023-02-21 0.141
> dput(GSY.dividends)
structure(c(0.02, 0.02, 0.023, 0.029, 0.141), class = c("xts",
"zoo"), dim = c(5L, 1L), index = structure(c(1642982400, 1645488000,
1647820800, 1650240000, 1676937600), tzone = "UTC", tclass = "Date"), dimnames = list(
NULL, "GSY.div"))Session Info
> sessionInfo()
R version 4.2.2 Patched (2022-11-10 r83330)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.5 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] quantmod_0.4.20.2 TTR_0.24.3 xts_0.13.0 zoo_1.8-11
loaded via a namespace (and not attached):
[1] compiler_4.2.2 tools_4.2.2 rstudioapi_0.14 curl_5.0.0 grid_4.2.2 jsonlite_1.8.4
[7] lattice_0.20-45Reactions are currently unavailable