Skip to content

time series interpolation

6 messages · Filipe Leme Botelho, David Winsemius, tomtomme +1 more

#
Hi there,
I?ve got a datatable in R which I try to interpolate with this and get the
Error below:
Error 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.
[1]   1   4  69 131 194 256 320 382
[1] 0.1211 0.1213 0.1233 0.1241 0.1250 0.1254 0.1255 0.1255
Regards,
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:
Error 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 Jun 29, 2011, at 2:37 PM, Filipe Leme Botelho wrote:

            
It looks to me that you are trying to assign a column vector into a  
dataframe but you are constructing it with five times as many elements  
as the dataframe has rows. I am unable to explain the error message,  
however. You say this is a 'datatable', so maybe the datatable  
maintainers would have a better idea, assuming you are using your  
terms correctly.
David Winsemius, MD
West Hartford, CT
#
Thanks for the hints. Eitherway I?ve found another solution now:

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)) 

--
View this message in context: http://r.789695.n4.nabble.com/time-series-interpolation-tp3633193p3635359.html
Sent from the R help mailing list archive at Nabble.com.
#
On Thu, Jun 30, 2011 at 6:10 AM, tomtomme <langkamp at tomblog.de> wrote:
More correctly, I answered the question you cross-posted on StackOverflow:
http://stackoverflow.com/questions/6520799/interpolate-time-series-of-multiple-tables
--
Joshua Ulrich  |  FOSS Trading: www.fosstrading.com