[R-SIG-Finance] Delete bad dividend row

Frank frankm60606 at gmail.com
Sun Jun 30 19:29:56 CEST 2013


Hi all,

I successfully get dividend data from Yahoo Finance, including a bad
dividend:

2012-12-20 0.039

How do I delete this one row from the data? This dividend shows up on the
Yahoo Finance site but is not reported by Philip Morris. 

Thanks,

Frank
Chicago, IL


R version 3.0.1 (2013-05-16) -- "Good Sport"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (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.

[Previously saved workspace restored]

> library(quantmod)
Loading required package: Defaults
Loading required package: xts
Loading required package: zoo

Attaching package: 'zoo'

The following object is masked from 'package:base':

    as.Date, as.Date.numeric

Loading required package: TTR
Version 0.4-0 included new data defaults. See ?getSymbols.
> library(chron)
> 
> from_date="2010-1-1"
> {Divs<-getDividends("PM",from=from_date)}
> Divs
            [,1]
2010-03-23 0.580
2010-06-22 0.580
2010-09-22 0.640
2010-12-21 0.640
2011-03-22 0.640
2011-06-21 0.640
2011-09-23 0.770
2011-12-20 0.770
2012-03-27 0.770
2012-06-25 0.770
2012-09-25 0.850
2012-12-20 0.039
2012-12-24 0.850
2013-03-26 0.850
2013-06-25 0.850
> 
> quit()
> proc.time()
   user  system elapsed 
   0.92    0.04    1.04



More information about the R-SIG-Finance mailing list