Hi R-Help People! I'm using the current version of R for Ubuntu: R version 4.2.1 (2022-06-23) -- "Funny-Looking Kid." I'm using the quantmod package and am having difficulty with the getDividends() function from the quantmod package. Here is my code:> library(quantmod)> > getDividends( "VOX" )Here is the output: Warning message: In read.table(file = file, header = header, sep = sep, quote = quote, : incomplete final line found by readTableHeader on 'https://query1.finance.yahoo.com/v7/finance/download/VOX?period1=-2208988800&period2=1663545600&interval=1d&events=split'> There was not an object in my work space like "VOC.div" or anything like that, so I'm pretty sure getDividends failed completely.... .... except for the slight possiblity that I did something wrong! Can somebody please tell me how to get getDividends to work? Thank you! Daryl Daryl's Rural Roadside Honor System Vegetable and Flower Stand and Occasional Dairy Produce Rural area, USA [[alternative HTML version deleted]]
You need to assign the result to an object. vox_div <- quantmod::getDividends("VOX") You should check to see if the dividends are split-adjusted or not. Yahoo has changed that several times over the years. Use the `split.adjust` argument to get the (un)adjusted dividends. The boolean may be backward because of Yahoo's changes. Best, Josh On Tue, Sep 20, 2022 at 11:48 AM Phil Smith via R-help <r-help at r-project.org> wrote:> > Hi R-Help People! > > I'm using the current version of R for Ubuntu: R version 4.2.1 (2022-06-23) -- "Funny-Looking Kid." > > I'm using the quantmod package and am having difficulty with the getDividends() function from the quantmod package. > > Here is my code: > > > library(quantmod) > > > > > getDividends( "VOX" ) > > Here is the output: > Warning message: > In read.table(file = file, header = header, sep = sep, quote = quote, : > incomplete final line found by readTableHeader on 'https://query1.finance.yahoo.com/v7/finance/download/VOX?period1=-2208988800&period2=1663545600&interval=1d&events=split'> > > There was not an object in my work space like "VOC.div" or anything like that, so I'm pretty sure getDividends failed completely.... > > .... except for the slight possiblity that I did something wrong! > > Can somebody please tell me how to get getDividends to work? > > Thank you! > Daryl > Daryl's Rural Roadside Honor System Vegetable and Flower Stand and Occasional Dairy Produce > Rural area, USA > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com
... and do note that a "warning" is not an "error." Often the correct result will still be obtained. -- Bert On Tue, Sep 20, 2022 at 9:48 AM Phil Smith via R-help <r-help at r-project.org> wrote:> Hi R-Help People! > > I'm using the current version of R for Ubuntu: R version 4.2.1 > (2022-06-23) -- "Funny-Looking Kid." > > I'm using the quantmod package and am having difficulty with the > getDividends() function from the quantmod package. > > Here is my code: > > > library(quantmod) > > > > > getDividends( "VOX" ) > > Here is the output: > Warning message: > In read.table(file = file, header = header, sep = sep, quote = quote, : > incomplete final line found by readTableHeader on ' > https://query1.finance.yahoo.com/v7/finance/download/VOX?period1=-2208988800&period2=1663545600&interval=1d&events=split > '> > > There was not an object in my work space like "VOC.div" or anything like > that, so I'm pretty sure getDividends failed completely.... > > .... except for the slight possiblity that I did something wrong! > > Can somebody please tell me how to get getDividends to work? > > Thank you! > Daryl > Daryl's Rural Roadside Honor System Vegetable and Flower Stand and > Occasional Dairy Produce > Rural area, USA > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
On Mon, 19 Sep 2022 20:47:55 +0000 Phil Smith via R-help <r-help at r-project.org> wrote:> incomplete final line found by readTableHeader on > 'https://query1.finance.yahoo.com/v7/finance/download/VOX?period1=-2208988800&period2=1663545600&interval=1d&events=split'When I follow the link myself, I get a CSV file that contains a single header line and no data lines at all. Not sure whether it's Yahoo's problem or quantmod's problem, but it's definitely related. -- Best regards, Ivan