library(utils)
data(ca533)
## Detrend using modified exponential decay. Returns a data.frame
ca533.rwi <- detrend(rwl = ca533, method = "ModNegExp")
## Detrend using a slines on power transformed data and compute
## residuals via subtraction
ca533.rwi <- detrend(rwl = powt(ca533), method = "Spline",
difference = TRUE)
## Detrend using modified Hugershoff curve and return info on the model
## fits. Returns a list with: series, curves, modelinfo and data.info
data(co021)
co021.rwi <- detrend(rwl = co021, method = "ModHugershoff",
return.info=TRUE)
if (FALSE) {
library(grDevices)
## Detrend using all methods. Returns a list
ca533.rwi <- detrend(rwl = ca533)
## Save a pdf of all series
fname <- tempfile(fileext=".pdf")
print(fname) # tempfile used for output
pdf(fname)
ca533.rwi <- detrend(rwl = ca533, method = c("Spline", "ModNegExp"),
make.plot = TRUE)
dev.off()
unlink(fname) # remove the file
}
Run the code above in your browser using DataLab