# NOT RUN {
# }
# NOT RUN {
# Load data
data("think_barley")
# Use example data to make predictions
out <- pop.predict2(G.in = G.in_ex_imputed, y.in = y.in_ex, map.in = map.in_ex,
crossing.table = cross.tab_ex)
# Provide a vector of parents to predict all possible crosses (some parents
# have missing phenotypic data)
out <- pop.predict2(G.in = G.in_ex_imputed, y.in = y.in_ex, map.in = map.in_ex,
parents = y.in_ex$Entry[1:5])
# Make predictions for 5 crosses with various levels of inbreeding
out_list <- lapply(X = 1:10, FUN = function(self.gen) {
out <- pop.predict2(G.in = G.in_ex_imputed, y.in = y.in_ex, map.in = map.in_ex,
crossing.table = cross.tab_ex[1:5,], self.gen = self.gen)
out$self.gen <- self.gen
out })
# Plot predictions of grain yield genetic variance over levels of inbreeding
dat <- do.call("rbind", lapply(out_list, subset, trait == "Yield"))
plot(pred_varG ~ self.gen, data = dat, type = "b",
subset = parent1 == parent1[1] & parent2 == parent2[1])
# }
# NOT RUN {
# Load data
data("think_barley")
# Use example data to make predictions
out <- pop_predict2(M = G.in_ex_mat, y.in = y.in_ex, map.in = map.in_ex,
crossing.table = cross.tab_ex)
# Provide a vector of parents to predict all possible crosses (some parents
# have missing phenotypic data)
out <- pop_predict2(M = G.in_ex_mat, y.in = y.in_ex, map.in = map.in_ex,
parents = y.in_ex$Entry[1:10])
# Make predictions for 5 crosses with various levels of inbreeding
out_list <- lapply(X = 1:10, FUN = function(self.gen) {
out <- pop_predict2(M = G.in_ex_mat, y.in = y.in_ex, map.in = map.in_ex,
crossing.table = cross.tab_ex[1:5,], self.gen = self.gen)
out$self.gen <- self.gen
out })
# Plot predictions of grain yield genetic variance over levels of inbreeding
dat <- do.call("rbind", lapply(out_list, subset, trait == "Yield"))
plot(pred_varG ~ self.gen, data = dat, type = "b",
subset = parent1 == parent1[1] & parent2 == parent2[1])
# }
Run the code above in your browser using DataLab