Dear R-helpers,

can I use a POSIXct date as the x variable in interpSpline? The help
page says x and y need to be numeric... is there a workaround?

example:

library(splines)
testdfr <- 
data.frame(Date=seq(as.POSIXct("2008-08-01"),as.POSIXct("2008-09-01"),
length=10))
testdfr$yvar <- rnorm(10)
sp <- interpSpline(yvar ~ Date, testdfr)

preddfr <- data.frame(Date=as.POSIXct("2008-08-02"))
predict(sp, preddfr)


thanks,
Remko


-------------------------------------------------
Remko Duursma
Post-Doctoral Fellow

Centre for Plant and Food Science
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753

Dept of Biological Science
Macquarie University
North Ryde NSW 2109
Australia

Mobile: +61 (0)422 096908

______________________________________________
R-help@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.

Reply via email to