correctSpatialHeterogeneity: Correct spatial heterogeneity

View source: R/spatial.R

correctSpatialHeterogeneityR Documentation

Correct spatial heterogeneity

Description

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.

Usage

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
)

Arguments

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)

Value

data frame as dat but with an additional column named <response>.csh

Author(s)

Timothee Flutre


timflutre/rutilstimflutre documentation built on Aug. 18, 2024, 7:43 p.m.