## The data from the Phenovator platform have been corrected for spatial
## trends and outliers for single observations have been removed.
## We need to specify the genotype-by-treatment interaction.
## Treatment: water regime (WW, WD).
spatCorrectedArch[["treat"]] <- substr(spatCorrectedArch[["geno.decomp"]],
start = 1, stop = 2)
spatCorrectedArch[["genoTreat"]] <-
interaction(spatCorrectedArch[["genotype"]],
spatCorrectedArch[["treat"]], sep = "_")
## Fit P-Splines Hierarchical Curve Data Model for selection of genotypes.
fit.psHDM <- fitSplineHDM(inDat = spatCorrectedArch,
trait = "LeafArea_corr",
genotypes = c("GenoA14_WD", "GenoA51_WD",
"GenoB11_WW", "GenoB02_WD",
"GenoB02_WW"),
time = "timeNumber",
pop = "geno.decomp",
genotype = "genoTreat",
plotId = "plotId",
difVar = list(geno = FALSE, plot = FALSE),
smoothPop = list(nseg = 4, bdeg = 3, pord = 2),
smoothGeno = list(nseg = 4, bdeg = 3, pord = 2),
smoothPlot = list(nseg = 4, bdeg = 3, pord = 2),
weights = "wt",
trace = FALSE)
## Plot the P-Spline predictions at the three levels of the hierarchy
## Population-specific growth curves.
plot(fit.psHDM,
plotType = "popTra")
## Population and genotype-specific growth curves.
plot(fit.psHDM,
plotType = "popGenoTra")
## First-order derivative of the population- and genotype-specific growth curves.
plot(fit.psHDM,
plotType = "popGenoDeriv")
## Genotype-specific deviations.
plot(fit.psHDM,
plotType = "genoDev")
## Genotype- and plot-specific growth curves.
plot(fit.psHDM,
plotType = "genoPlotTra")
Run the code above in your browser using DataLab