correctSpatialHeterogeneity | R Documentation |
Use kriging to correct spatial heterogeneity in a plant field trial. Kriging (i.e. prediction) is performed per year. Then, the predicted responses that controls would have had if they had been planted everywhere are subtracted from the observed responses from the other genotypes.
correctSpatialHeterogeneity(
dat,
response,
fix.eff = NULL,
min.ctls.per.year = 10,
cressie = TRUE,
vgm.model = c("Exp", "Sph", "Gau", "Ste"),
nb.folds = 5,
out.prefix = NULL,
verbose = 1
)
dat |
data frame with, at least, columns named "geno", "control" (TRUE/FALSE), "rank", "location", "year" and <response> |
response |
column name of dat corresponding to the response for which spatial heterogeneity will be corrected |
fix.eff |
if not NULL, vector of column names of data corresponding to fixed effects to control for in the kriging (e.g. "block") |
min.ctls.per.year |
minimum number of control data points in a given year to proceed |
cressie |
if TRUE, the variogram function from the gstat package uses Cressie's robust variogram estimate, else it uses the classical method of moments |
vgm.model |
type(s) of variogram model(s) given to the vgm function of the gstat package; if several, the best one (smaller sum of squared errors) will be used |
nb.folds |
number of folds for the cross-validation |
out.prefix |
prefix of the output files to save plots and results (if not NULL) |
verbose |
verbosity level (0/1/2) |
data frame as dat but with an additional column named <response>.csh
Timothee Flutre
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.