FuncDetectOutlierPlantMaize: FuncDetectOutlierPlantMaize

Description Usage Arguments Details Value Examples

View source: R/outlierDetection.R

Description

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

plants are identified as "small outlier plant"

if for biomass AND phyllocron res_i < mu_res - qnorm(threshold) * sd_res

plants are identified as "big outlier plant"

if for biomass AND plant height res_i > mu_res + qnorm(threshold) * sd_res

Usage

 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
)

Arguments

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)

Details

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

1

the estimated biomass, numeric

2

the estimated plant height, numeric

3

the estimated phyllocron, numeric

4

the genotype id, character

5

the lines in the greenhouse or lattice, numeric

6

the columns in the greenhouse or lattice, numeric

In other kind of lattice platform

1

param1 a numeric phenotypic parameter

2

param2 a numeric phenotypic parameter

3

param3 a numeric phenotypic parameter

4

the genotype id, character

5

the lines in the platform or lattice, numeric

6

the columns in the platform or lattice, numeric

Value

return a list of 4 elements

outputDataframe

a data.frame with the used data set, the fitted values and residuals calculated by the model, the flag of outliers

smallOutlier

a data.frame of the detected "small" outliers

bigOutlier

a data.frame of the detected "big" outliers

m1

A list of the SpATS results for param1 (see the SpATS() help)

m2

A list of the SpATS results for param2 (see the SpATS() help)

m3

A list of the SpATS results for param3 (see the SpATS() help)

Examples

 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)

sanchezi/openSilexStatR documentation built on Sept. 10, 2020, 1:03 p.m.