Hi there, I?ve got a datatable in R which I try to interpolate with this and get the Error below:> new$temp<- approx(w03_11temp$temp, n = (nrow(w03_11temp)*5))$yError in new$temp <- approx(w03_11temp$temp, n = (nrow(w03_11temp) * 5))$y : Object of type 'closure' not registered Any idea?? Thanks a lot. -- View this message in context: http://r.789695.n4.nabble.com/time-series-interpolation-tp3633193p3633193.html Sent from the R help mailing list archive at Nabble.com.
Hi Tom, At least to me it?s hard to picture what?s wrong without further details regarding your data. I use spline/linear interpolation of time series regularly, so maybe this example help you out.> ci_x[1] 1 4 69 131 194 256 320 382> ci_y[1] 0.1211 0.1213 0.1233 0.1241 0.1250 0.1254 0.1255 0.1255> > approx(x=ci_x, y=ci_y, n=ci_x[length(ci_x)])$yRegards, Filipe. -----Mensagem original----- De: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] Em nome de tomtomme Enviada em: quarta-feira, 29 de junho de 2011 12:28 Para: r-help at r-project.org Assunto: [R] time series interpolation Hi there, I?ve got a datatable in R which I try to interpolate with this and get the Error below:> new$temp<- approx(w03_11temp$temp, n = (nrow(w03_11temp)*5))$yError in new$temp <- approx(w03_11temp$temp, n = (nrow(w03_11temp) * 5))$y : Object of type 'closure' not registered Any idea?? Thanks a lot. -- View this message in context: http://r.789695.n4.nabble.com/time-series-interpolation-tp3633193p3633193.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. "This message and its attachments may contain confidential and/or privileged information. If you are not the addressee, please, advise the sender immediately by replying to the e-mail and delete this message." "Este mensaje y sus anexos pueden contener informaci?n confidencial o privilegiada. Si ha recibido este e-mail por error por favor b?rrelo y env?e un mensaje al remitente." "Esta mensagem e seus anexos podem conter informa??o confidencial ou privilegiada. Caso n?o seja o destinat?rio, solicitamos a imediata notifica??o ao remetente e exclus?o da mensagem."
On Thu, Jun 30, 2011 at 6:10 AM, tomtomme <langkamp at tomblog.de> wrote:> Thanks for the hints. Eitherway I?ve found another solution now: >More correctly, I answered the question you cross-posted on StackOverflow: http://stackoverflow.com/questions/6520799/interpolate-time-series-of-multiple-tables> w03_11temp<-read.delim2("w03_11.ASC", fileEncoding="ISO-8859-15", skip = 4) > colnames(w03_11temp) <- c("date", "time", "temp") > library(zoo) > w03_11temp_z <- zoo(w03_11temp$temp, > ?as.POSIXct(paste(w03_11temp$date, w03_11temp$time), format="%d.%m.%y > %H:%M:%S")) > w03_11temp_y <- merge(w03_11temp_z, zoo(order.by=seq(start(w03_11temp_z), > end(w03_11temp_z), by=1))) > w03_11temp_x <- na.approx(w03_11temp_y) > w03_11temp_w <- data.frame(date=format(index(w03_11temp_x), "%d.%m.%y"), > ? ? ? ? ? ? ? ? ? time=format(index(w03_11temp_x), "%H:%M:%S"), > temp=coredata(w03_11temp_x)) > >-- Joshua Ulrich | FOSS Trading: www.fosstrading.com
I appologize, I should have mentioned that by myself, but was in such a hurry... - I myself would never have found a solution.... Thanks again! -- View this message in context: http://r.789695.n4.nabble.com/time-series-interpolation-tp3633193p3635733.html Sent from the R help mailing list archive at Nabble.com.