data.framesmooth.spline to fit a spline to all the values of
response stored in data.
The amount of smoothing is controlled by df. The derivatives
of the fitted spline can also be obtained, as can the Relative
Growth Rate (RGR).fitSpline(data, response, x, df=NULL, deriv=NULL, suffices.deriv=NULL, RGR=NULL, na.rm=FALSE)data.frame containing the column to be smoothed.character giving the name of the column in
data that is to be smoothed.character giving the name of the column in
data that contains the values of the predictor variable.numeric specifying the desired equivalent number of degrees
of freedom of the smooth (trace of the smoother matrix). Lower values
result in more smoothing. If df = NULL, ordinary leave-one-out
cross-validation is used to determine the amount of smooth.numeric specifying one or more orders of derivatives
that are required.character giving the characters to be
appended to the names of the derivatives.character giving the character to be appended
to the name of the RGR. If RGR is not NULL,
deriv must include 1 so that the the first derivative is
available for caluclating the RGR. If RGR is NULL,
the RGR is not calculated.logical indicating whether or not rows of data
with NAs are to be removed prior to smoothing.data.frame containing x and the fitted smooth. The names
of the columns will be the value of x and the value of response
with .smooth appended. If deriv is not NULL, columns
containing the values of the derivative(s) will be added to the
data.frame; the name each of of these columns will be the value of
response with .smooth.dvf appended, where
f is the order of the derivative, or the value of response
with .smooth. and the corresponding element of
suffices.deriv appended. If RGR is not NULL, the RGR
is calculated as the ratio of value of the first derivative of the fitted
spline and the fitted value for the spline.splitSplines, smooth.spline,
predict.smooth.spline, splitContGRdiffdata(exampleData)
fit <- fitSpline(longi.dat, response="Area", , x="xDays", df = 4,
deriv=c(1,2), suffices.deriv=c("AGRdv","Acc"))
Run the code above in your browser using DataLab