View source: R/genomic_selection.R
gs_summaries | R Documentation |
Generates summaries of predictions from different folds for Genomic Selection analysis.
gs_summaries(predictions, save_at = NULL, digits = 4)
predictions |
( |
save_at |
( |
digits |
( |
A list
with 3 summaries: "line"
, "env"
and "fold"
.
## Not run:
# For a continuous response ------------------------------------------------
set.seed(1)
# Simulated data
predictions <- data.frame(
Fold = rep(c("F1", "F2"), each = 24),
Env = rep(c("E1", "E2"), each = 12),
Line = rep(c("L1", "L2", "L3"), 16),
Observed = rnorm(48, 10, 1),
Predicted = rnorm(48, 10, 1)
)
summaries <- gs_summaries(predictions, save_at = "numeric_summaries")
summaries$line
summaries$env
summaries$fold
# For a categorical response ------------------------------------------------
set.seed(2)
# Simulated data
predictions <- data.frame(
Fold = rep(c("F1", "F2"), each = 24),
Env = rep(c("E1", "E2"), each = 12),
Line = rep(c("L1", "L2", "L3"), 16),
Observed = sample(c("A", "B"), 24, TRUE),
A = runif(48, 0, 1)
) %>%
dplyr::mutate(
B = 1 - A,
Predicted = factor(ifelse(A > 0.5, "A", "B")),
Observed = factor(Observed)
)
summaries <- gs_summaries(predictions, save_at = "categorical_summaries")
summaries$line
summaries$env
summaries$fold
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.