Description Usage Arguments Details Value Author(s) References Examples
batch1
This function carries out batch analysis for
mult-trait with same model and also output heritability etc. in breedR package.
1 2 |
data |
aim dataset |
FMod |
Fixed mode,should be 'y~1+fixed.factors'. |
RMod |
Randomed mode, should be '~random.factors'. |
geneticM |
Randomed terms for tree model, details see example. |
SpM |
Spatial error terms. details see example. |
pformula |
formula for h2 (or corr). |
breedR batch analysis
the result is returned directly.
Yuanzhen Lin <yzhlinscau@163.com>
breedRPlus website:https://github.com/yzhlinscau/
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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | library(breedR)
library(breedRPlus)
library(tidyr)
data(douglas)
S3<-subset(douglas,site=='s3')
#summary(S3);str(S3)
S3a<-filter(S3,is.na(dad)) # hs
S3a<-transform(S3a,Mum=factor(mum))
S3a<-droplevels(S3a)
names(S3a)[7:8]<-c('x1','y1')
df<-tidyr::gather(S3a,key=Trait,y,c(-1:-8,-12,-14:-16))
#str(df)
# for parent model
fixed = y ~ 1+orig
random1=~Mum+block
pformula1=h2~4*V1/(V1+V3)
mm<-plyr::ddply(df,'Trait',
function(dat) batch1(dat,FMod=fixed,
RMod=random1,
pformula=pformula1)
)
#result
mm
# for tree model
random2=~block
genetic=list(model = 'add_animal',
pedigree = S3a[,1:3],
id = 'self')
pformula2=h2~V2/(V2+V3)
mm1<-plyr::ddply(df,'Trait',
function(dat) batch1(dat,FMod=fixed,
RMod=random2,
geneticM=genetic,
pformula=pformula2)
)
#result
mm1
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.