Bazman76
2012-Apr-01 18:15 UTC
[R] Error in xy.coords(x, NULL, log = log) : (list) object cannot be coerced to type 'double'
Hi there, When I run the code below I get the error Error in xy.coords(x, NULL, log = log) :(list) object cannot be coerced to type 'double' Any tips how I can resolve this?> > library("waveslim") > > vols=read.csv(file="C:/Users/ocuk/My Documents/Abs Vol.csv", header=TRUE, > sep=",") > x<-c(vols[,1]) > #x > #data(ibm) > av.la8 <- mra(x, "la8", 4, "modwt") > #names(av.la8) <- c("d1", "d2", "d3", "d4","d5","d6", "d7", "d8","s8") > names(av.la8) <- c("d1", "d2", "d3", "d4","s4") > #par(mfcol=c(10,1), pty="m", mar=c(5-2,4,4-2,2)) > par(mfcol=c(6,1), pty="m", mar=c(5-2,4,4-2,2)) > plot.ts(av.la8, axes=F, ylab="", main="abs vol")*Error in xy.coords(x, NULL, log = log) : (list) object cannot be coerced to type 'double'*> #for(i in 1:9) > for(i in 1:5)+ plot.ts(av.la8[[i]], axes=F, ylab=names(av.la8)[i])> axis(side=1, at=seq(0,1541,by=100),+ labels=c(0,"",200,"",400,"",600,"",800,"",1000,"",1200,"",1400,"")) -- View this message in context: http://r.789695.n4.nabble.com/Error-in-xy-coords-x-NULL-log-log-list-object-cannot-be-coerced-to-type-double-tp4524046p4524046.html Sent from the R help mailing list archive at Nabble.com.
Uwe Ligges
2012-Apr-08 15:46 UTC
[R] Error in xy.coords(x, NULL, log = log) : (list) object cannot be coerced to type 'double'
On 01.04.2012 20:15, Bazman76 wrote:> Hi there, > > When I run the code below I get the error > > Error in xy.coords(x, NULL, log = log) :(list) object cannot be coerced to > type 'double' > > Any tips how I can resolve this?The mra output is a list, hence plot.ts cannot handle it. You probably want to plot the original data in the first place given you are following the example from ?mra Uwe Ligges> >> >> library("waveslim") >> >> vols=read.csv(file="C:/Users/ocuk/My Documents/Abs Vol.csv", header=TRUE, >> sep=",") >> x<-c(vols[,1]) >> #x >> #data(ibm) >> av.la8<- mra(x, "la8", 4, "modwt") >> #names(av.la8)<- c("d1", "d2", "d3", "d4","d5","d6", "d7", "d8","s8") >> names(av.la8)<- c("d1", "d2", "d3", "d4","s4") >> #par(mfcol=c(10,1), pty="m", mar=c(5-2,4,4-2,2)) >> par(mfcol=c(6,1), pty="m", mar=c(5-2,4,4-2,2)) >> plot.ts(av.la8, axes=F, ylab="", main="abs vol") > *Error in xy.coords(x, NULL, log = log) : > (list) object cannot be coerced to type 'double'* >> #for(i in 1:9) >> for(i in 1:5) > + plot.ts(av.la8[[i]], axes=F, ylab=names(av.la8)[i]) >> axis(side=1, at=seq(0,1541,by=100), > + labels=c(0,"",200,"",400,"",600,"",800,"",1000,"",1200,"",1400,"")) > > -- > View this message in context: http://r.789695.n4.nabble.com/Error-in-xy-coords-x-NULL-log-log-list-object-cannot-be-coerced-to-type-double-tp4524046p4524046.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > 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.
Maybe Matching Threads
- Need help in waveslim package: imodwt and universal.thresh.modwt
- ??: Re:??: Re: Need help in waveslim package: imodwt and universal.thresh.modwt
- ??: Re: Need help in waveslim package: imodwt and universal.thresh.modwt
- Filters in waveslim
- how to write data using xlsReadWrite