Learn R Programming

fda (version 6.2.0)

dateAccessories: Numeric and character vectors to facilitate working with dates

Description

Numeric and character vectors to simplify functional data computations and plotting involving dates.

Arguments

Format

dayOfYear

a numeric vector = 1:365 with names 'jan01' to 'dec31'.

dayOfYearShifted

a numeric vector = c(182:365, 1:181) with names 'jul01' to 'jun30'.

day.5

a numeric vector = dayOfYear-0.5 = 0.5, 1.5, ..., 364.5

daysPerMonth

a numeric vector of the days in each month (ignoring leap years) with names = month.abb

monthEnd

a numeric vector of cumsum(daysPerMonth) with names = month.abb

monthEnd.5

a numeric vector of the middle of the last day of each month with names = month.abb = c(Jan=30.5, Feb=58.5, ..., Dec=364.5)

monthBegin.5

a numeric vector of the middle of the first day of each month with names - month.abb = c(Jan=0.5, Feb=31.5, ..., Dec=334.5)

monthMid

a numeric vector of the middle of the month = (monthBegin.5 + monthEnd.5)/2

monthLetters

A character vector of c("j", "F", "m", "A", "M", "J", "J", "A", "S", "O", "N", "D"), with 'month.abb' as the names.

weeks

a numeric vector of length 53 marking 52 periods of approximately 7 days each throughout the year = c(0, 365/52, ..., 365)

Details

Miscellaneous vectors often used in 'fda' scripts.

References

Ramsay, James O., Hooker, Giles, and Graves, Spencer (2009), Functional data analysis with R and Matlab, Springer, New York.

Ramsay, James O., and Silverman, Bernard W. (2005), Functional Data Analysis, 2nd ed., Springer, New York.

Ramsay, James O., and Silverman, Bernard W. (2002), Applied Functional Data Analysis, Springer, New York.

See Also

axisIntervals month.abb

Examples

Run this code
daybasis65 <- create.fourier.basis(c(0, 365), 65)
daytempfd <- with(CanadianWeather, smooth.basisPar(day.5,
    dailyAv[,,"Temperature.C"], daybasis65)$fd )
oldpar <- par(axes=FALSE)
plot(daytempfd)
axisIntervals(1)
# axisIntervals by default uses
# monthBegin.5, monthEnd.5, monthMid, and month.abb
axis(2)
par(oldpar)

Run the code above in your browser using DataLab