Description Usage Arguments Details Value Examples
View source: R/fb_spatial_adj.R
Uses a moving grid to adjust the phenotypic observations recorded in a Field Book
table. This function wraps around functions provided in the mvngGrAd
package.
1 2 | fb_spatial_adj(fbt, traits, checks, grid.size = NULL,
max.grid.size = NULL, use.rel.eff = TRUE)
|
fbt |
A Field Book Table object. |
traits |
Traits to be adjusted. Defaults to all numeric traits. |
checks |
A |
grid.size |
A nested |
max.grid.size |
A nested |
use.rel.eff |
If |
This function uses the moving average procedure implemented in mvngGrAd
to spatially adjust the raw phenotypic observations from a grid. Briefly,
the function uses the mean of observations surrounding a particularly plot
in a field as a covariate to calculate the adjusted phenotypic value.
One can define the dimensions of the grid by passing a list to the grid.size
argument. The first layer of the list must be the same length as the number
of traits, and the names of this layer must be the trait names. The second
layer of the list must have the components grid.rows
, grid.cols
,
and grid.layers
. grid.rows
and grid.cols
define the
number of field rows and columns covered by the grid, respectively,
while grid.layers
defines the number of diagonal plots.
Alternatively, one can optimize the grid size for each trait. Grid optimization iterates over all possible grid dimensions and identifies the grid size that maximizes the correlation between the adjusted phenotypic values and the mean of the phenotypic values within that grid.
Finally, the adjusted phenotypic values can be kept or ignored depending
on whether the within-environment variance (i.e. V_R) is reduced after
adjustment. This function uses the individuals specified in checks
to
calculate this variance. Generally, traits that are less heritable tend to
benefit from spatial adjustment.
A list with two elements:
An fbt object with adjusted phenotypic values replacing the original values, if applicable.
A list with 2 elements: the first returns the grid size used for each trait. The second returns summary statistics of the adjustment procedure, including the within-environment variance, relative efficiency, and whether the adjusted values were returned in place of the original values.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | data("fbt_sample")
# Specify a grid size
grid.size <- list(SpatialGradient = list(grid.rows = 5, grid.cols = 5, grid.layers = 5))
adj_out <- fb_spatial_adj(fbt = fbt_sample, traits = "SpatialGradient",
checks = c("Kharkof", "TAM 107", "Scout 66"),
grid.size = grid.size)
## Not run:
# Run spatial adjustment without conditions
adj_out <- fb_spatial_adj(fbt = fbt_sample, traits = "SpatialGradient",
checks = c("Kharkof", "TAM 107", "Scout 66"))
# Observe the output
# Restrict the grid size
max.grid.size <- list(SpatialGradient = list(grid.rows = 5, grid.cols = 5, grid.layers = 5))
# Re-run spatial adjustment
adj_out <- fb_spatial_adj(fbt = fbt_sample, traits = "SpatialGradient",
checks = c("Kharkof", "TAM 107", "Scout 66"),
max.grid.size = max.grid.size)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.