Nothing
## ----setup, message=FALSE---------------------------------------------------------------
library("knitr")
knitr::opts_chunk$set(fig.align="center", fig.width=6, fig.height=6)
options(width=90)
## ----gge--------------------------------------------------------------------------------
library(agridat)
data(yan.winterwheat)
dat1 <- yan.winterwheat
library(gge)
m1 <- gge(dat1, yield~gen*env, scale=FALSE)
biplot(m1, main="yan.winterwheat - GGE biplot",
flip=c(1,0), origin=0, hull=TRUE)
## ---------------------------------------------------------------------------------------
m2 <- gge(dat1, yield~gen*env, scale=TRUE)
biplot(m2, main="yan.winterwheat - GGE biplot",
flip=c(1,1), origin=0)
## ---------------------------------------------------------------------------------------
biplot(m2, main="yan.winterwheat - GGE biplot - PC 2 & 3",
comps=c(2,3), flip=c(1,1), origin=0)
## ----mosaic-----------------------------------------------------------------------------
plot(m1, main="yan.winterwheat")
## ----ggb--------------------------------------------------------------------------------
library(agridat)
data(crossa.wheat)
dat2 <- crossa.wheat
# Define mega-environment groups of locations
dat2$eg <- ifelse(is.element(dat2$loc,
c("KN","NB","PA","BJ","IL","TC",
"JM","PI","AS","ID","SC","SS",
"SJ","MS","MG","MM")), "Grp1", "Grp2")
library(gge)
# Specify env.group as column in data frame
m3 <- gge(dat2, yield~gen*loc, env.group=eg, scale=FALSE)
biplot(m3, main="crossa.wheat - GGB biplot")
## ---- eval=0----------------------------------------------------------------------------
u <- Xc.svd$u
s <- diag(Xc.svd$d)
v <- Xc.svd$v
(u %*% s)[,1:2]
t[,1:2]
## ---- eval=0----------------------------------------------------------------------------
v[,1:2]
p[,1:2]
## ---- eval=0----------------------------------------------------------------------------
u[,1:2]
sv <- sqrt(Xc.pca$eig)
(t %*% diag(1/sv))[,1:2]
## ---- eval=0----------------------------------------------------------------------------
(v %*% s)[,1:2]
(p %*% diag(sv))[,1:2]
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.