smooths.frame {growthPheno} | R Documentation |
Description of a smooths.frame object
Description
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
.
Value
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:
-
individuals
, thecharacter
giving the name of thefactor
that define the subsets of thedata
for which each subset corresponds to theresponse
values for an individual; -
n
, the number of uniqueindividuals
; -
times
, thecharacter
giving the name of thenumeric
, orfactor
with numeric levels, that contains the values of the predictor variable plotted on the x-axis; -
t
, the number of unique values in thetimes
; -
nschemes
, the number of unique combinations of the smoothing-parameter values in thesmoothsframe
.
Author(s)
Chris Brien
See Also
probeSmooths
, is.smooths.frame
,
as.smooths.frame
, validSmoothsFrame
, args4smoothing
Examples
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")
is.smooths.frame(dat)
validSmoothsFrame(dat)
data(exampleData)
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(plots.by = NULL,
facet.x = "Tuning",
facet.y = "Treatment.1",
include.raw = "no",
ggplotFuncs = vline))
is.smooths.frame(smths)
validSmoothsFrame(smths)