smooths.frame: Description of a smooths.frame object

smooths.frameR Documentation

Description of a smooths.frame object


A data.frame of S3-class smooths.frame that stores the smooths of one or more responses for several sets of smoothing parameters.

as.smooths.frame is function that converts a data.frame to an object of this class.

is.smooths.frame is the membership function for this class; it tests that an object has class smooths.frame.

validSmoothsFrame can be used to test the validity of a smooths.frame.


A data.frame that is also inherits the S3-class smooths.frame. It contains the results of smoothing a response over time from a set of individuals, the data being arranged in long format both with respect to the times and the smoothing-parameter values used in the smoothing. That is, each response occupies a single column. The smooths.frame must include the columns Type, TunePar, TuneVal, Tuning (the combination of TunePar and TuneVal) and Method, and the columns that would be nominated using the probeSmooths arguments individuals, the plots and facet arguments, times, response, response.smoothed, and, if requested, the AGR and the RGR of the response and response.smoothed. The names of the growth rates should be formed from response and response.smoothed by adding .AGR and .RGR to both of them. The function probeSmooths produces a smooths.frame for a response.

A smooths.frame has the following attributes:

  1. individuals, the character giving the name of the factor that define the subsets of the data for which each subset corresponds to the response values for an individual;

  2. n, the number of unique individuals;

  3. times, the character giving the name of the numeric, or factor with numeric levels, that contains the values of the predictor variable plotted on the x-axis;

  4. t, the number of unique values in the times;

  5. nschemes, the number of unique combinations of the smoothing-parameter values in the smoothsframe.


Chris Brien

See Also

probeSmooths, is.smooths.frame, as.smooths.frame, validSmoothsFrame, args4smoothing


dat <- read.table(header = TRUE, text = "
Type TunePar TuneVal Tuning Method       ID  DAP   PSA      sPSA
NCSS      df       4   df-4 direct 045451-C   28 57.446 51.18456
NCSS      df       4   df-4 direct 045451-C   30 89.306 87.67343
NCSS      df       7   df-7 direct 045451-C   28 57.446 57.01589
NCSS      df       7   df-7 direct 045451-C   30 89.306 87.01316
dat[1:7] <- lapply(dat[1:6], factor)
dat <- as.smooths.frame(dat, individuals = "ID", times = "DAP")

vline <- list(ggplot2::geom_vline(xintercept=29, linetype="longdash", size=1))
smths <- probeSmooths(data = longi.dat, 
                      response = "PSA", response.smoothed = "sPSA", 
                      times = "DAP", 
                      smoothing.args = 
                         args4smoothing(smoothing.methods = "direct", 
                                        spline.types = "NCSS", 
                                        df = c(4,7), lambdas = NULL), 
                      profile.plot.args = 
                        args4profile_plot( = NULL, 
                                          facet.x = "Tuning", 
                                          facet.y = "Treatment.1", 
                                          include.raw = "no", 
                                          ggplotFuncs = vline))

growthPheno documentation built on May 29, 2024, 6:03 a.m.