#daytime <- (1:365)-0.5
#dayrange <- c(0,365)
#dayperiod <- 365
#nbasis <- 65
#dayrange <- c(0,365)
daybasis65 <- create.fourier.basis(c(0, 365), 65)
harmaccelLfd <- vec2Lfd(c(0,(2*pi/365)^2,0), c(0, 365))
harmfdPar <- fdPar(daybasis65, harmaccelLfd, lambda=1e5)
daytempfd <- with(CanadianWeather, data2fd(
dailyAv[,,"Temperature.C"], day.5,
daybasis65,argnames=list("Day", "Station", "Deg C")) )
# plot all the temperature functions for the monthly weather data
plot(daytempfd, main="Temperature Functions")
# To plot one at a time:
# The following pauses to request page changes.
# (Without 'dontrun', the package build process
# might encounter problems with the par(ask=TRUE)
# feature.)
plot(daytempfd, main="Temperature Functions", ask=TRUE)
Run the code above in your browser using DataLab