[R-SIG-Finance] Re : Got a error message with a OpCl(x).

pierre8r-list at yahoo.fr pierre8r-list at yahoo.fr
Thu Jul 24 12:02:28 CEST 2008


Answer to myself :

Add :
colnames(x) <- c('Open','High','Low','Close','Volume')
before 
OpCl(x)



--- En date de : Jeu 24.7.08, pierre8r-list at yahoo.fr <pierre8r-list at yahoo.fr> a écrit :

> De: pierre8r-list at yahoo.fr <pierre8r-list at yahoo.fr>
> Objet: [R-SIG-Finance] Got a error message with a OpCl(x).
> À: r-sig-finance at stat.math.ethz.ch
> Date: Jeudi 24 Juillet 2008, 11h52
> Hi,
> 
> I have this message error :
> 
> Error in attr(x, "tsp") <- c(1, NROW(x), 1) : 
>   attempt to set an attribute on NULL
> 
> 
> With this R code :
> 
> 
> library(quantmod) # this also pulls in zoo
> library(xts) # this also pulls in zoo
> 
> Lines <-
> "2007-12-03  100.00  110.00  90.00  110.00  10.0
> 2007-12-04  110.00  120.00 100.00  120.00 10.0
> 2007-12-05  120.00  130.00 110.00  130.00 10.0
> 2007-12-06  130.00  140.00 120.00  140.00 10.0
> 2007-12-07  140.00  140.00 120.00  140.00 10.0
> 2007-12-08  130.00  130.00 110.00  120.00 10.0
> 2007-12-09  120.00  120.00 120.00  140.00 10.0
> 2007-12-10  110.00  130.00 120.00  140.00 10.0
> 2007-12-11  100.00  120.00 120.00  140.00 10.0"
> 
> 
> x <- read.zoo(textConnection(Lines))
> x <- as.xts(x)
> 
> OpCl(x)
> 
> 
> 
> 
> 
>      
> ____________________________________________________________
> ente http://mail.yahoo.fr
> 
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.


      _____________________________________________________________________________ 
Envoyez avec


More information about the R-SIG-Finance mailing list