Description Usage Arguments Details Value Examples
View source: R/outlierDetection.R
function to detect plant outliers in a temporal lattice experiment on Maize which can be extended to others experiment types. The criteria needs 3 phenotypes (ex for maize: the estimated biomass, plant height and phyllocron) Please, take a look of the structure of the example dataset: plant4
if for biomass AND phyllocron res_i < mu_res - qnorm(threshold) * sd_res
if for biomass AND plant height res_i > mu_res + qnorm(threshold) * sd_res
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | FuncDetectOutlierPlantMaize(
datain,
dateBeforeTrt,
param1,
param2,
param3,
paramGeno,
paramCol,
paramRow,
threshold,
nCol,
nRow,
genotype.as.random = FALSE,
timeColumn
)
|
datain |
input dataframe, a spatio-temporal data.frame |
dateBeforeTrt |
character, date just before treatment in the experiment |
param1 |
character, name of a phenotypic variable in datain (ex: Biomass) |
param2 |
character, name of a phenotypic variable in datain (ex: plant height) |
param3 |
character, name of a phenotypic variable in datain (ex: phyllocron) |
paramGeno |
character, name of the genotype variable in datain |
paramCol |
character, name of the Line variable in the datain |
paramRow |
character, name of the position variable in datain |
threshold |
numeric, |
nCol |
numeric, nunber of lines in the lattice platform (28 for phenoarch) |
nRow |
numeric, nunber of columns in the lattice platform (60 for phenoarch) |
genotype.as.random |
logical, If TRUE, the genotype is included as random effect in the model. The default is FALSE. (see the SpATS() help) |
timeColumn |
character, name of the time points column in datain (ex: Time) |
see SpATS() from the SpATS R library The input dataset must contain the following columns: In the case of a plant experiment in phenoarch platform
the estimated biomass, numeric
the estimated plant height, numeric
the estimated phyllocron, numeric
the genotype id, character
the lines in the greenhouse or lattice, numeric
the columns in the greenhouse or lattice, numeric
In other kind of lattice platform
param1 a numeric phenotypic parameter
param2 a numeric phenotypic parameter
param3 a numeric phenotypic parameter
the genotype id, character
the lines in the platform or lattice, numeric
the columns in the platform or lattice, numeric
return a list of 4 elements
a data.frame with the used data set, the fitted values and residuals calculated by the model, the flag of outliers
a data.frame of the detected "small" outliers
a data.frame of the detected "big" outliers
A list of the SpATS results for param1 (see the SpATS() help)
A list of the SpATS results for param2 (see the SpATS() help)
A list of the SpATS results for param3 (see the SpATS() help)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | library(ggplot2)
test<-FuncDetectOutlierPlantMaize(datain=PAdata,dateBeforeTrt="2017-04-27",
param1="Biomass_Estimated",param2="Height_Estimated",
param3="phyllocron",paramGeno="Genotype",
paramCol="Col",paramRow="Row",
threshold=0.95,nCol=28,nRow=60,genotype.as.random=FALSE,
timeColumn = "Time")
plot(test$m1)
plot(test$m2)
plot(test$m3)
ggplot(data=test$outputDataframe,aes(x=fittedP1,y=devResP1)) + geom_point()
ggplot(data=test$outputDataframe,aes(x=fittedP2,y=devResP2)) + geom_point()
ggplot(data=test$outputDataframe,aes(x=fittedP3,y=devResP3)) + geom_point()
# a summary of the detected outlier
print(test$smallOutlier)
print(test$bigOutlier)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.