View source: R/detectSingleOut.R
detectSingleOut | R Documentation |
Detect outlying observations in a time series by modeling each plotId using a local regression.
detectSingleOut(
TP,
trait,
plotIds = NULL,
checkEdges = TRUE,
confIntSize = 5,
nnLocfit = 0.5
)
TP |
An object of class |
trait |
A character vector indicating the trait to model in |
plotIds |
A character vector of plotIds for which the outliers should be
detected. If |
checkEdges |
Before fitting the local regression should a check be done if the first and last time point for a plot are outlying observations? |
confIntSize |
A numeric value defining the confidence interval (see Details). |
nnLocfit |
A numeric value defining the constant component of the smoothing parameter nn (see Details). |
See locfit() help function from the locfit R library. The user can act on:
the constant of the smoothing parameter. Increase nnLocfit to have a very smooth curve
the level to calculate the confidence interval. Increase confIntSize to exclude less outliers
An object of class singleOut, a data.frame
with the following
columns.
plotId
time point
modeled trait
prediction from the local regression
standard deviation of the prediction
lower bound of the confidence interval
upper bound of the confidence interval
flag for detected outlier (a value of 1 indicates the observation is an outlier)
Other functions for detecting outliers for single observations:
detectSingleOutMaize()
,
plot.singleOut()
,
removeSingleOut()
## Create a TP object containing the data from the Phenovator.
PhenovatorDat1 <- PhenovatorDat1[!PhenovatorDat1$pos %in%
c("c24r41", "c7r18", "c7r49"), ]
phenoTP <- createTimePoints(dat = PhenovatorDat1,
experimentName = "Phenovator",
genotype = "Genotype",
timePoint = "timepoints",
repId = "Replicate",
plotId = "pos",
rowNum = "y", colNum = "x",
addCheck = TRUE,
checkGenotypes = c("check1", "check2",
"check3", "check4"))
## First select a subset of plants, for example here 9 plants
plantSel <- phenoTP[[1]]$plotId[1:9]
# Then run on the subset
resuVatorHTP <- detectSingleOut(TP = phenoTP,
trait = "EffpsII",
plotIds = plantSel,
confIntSize = 3,
nnLocfit = 0.1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.