这几天对主函数echidna()代码做了一些,主要是增加代码修改,使得该包用法更符合R语言的风格。当然,之前的用法仍旧保留下来。
AFEchidna包主函数echidna()用法(新版本)如下:
echidna(es0.file,trait,fixed,random,residual,
foldN,delf,mulT,met,cycle,
predict,vpredict,
qualifier,jobqualf)
针对上述函数中的参数fixed、random和residual做了代码修改,除了原先用法,现在可以使用R语言风格的赋值,对于熟悉asreml-R的用户,这种新写法会更顺手。
旧用法的示例如下:
// old style
library(AFEchidna)
path<-"C:/Users/yzhlinscau/Desktop/echi/exam"
setwd(path)
res11<-echidna(es0.file="fm.es0",trait='h3',
fixed='Rep',random='Fam',
residual=NULL,
predict=c('Fam') )
运行过程如下:
// old style
> res11<-echidna(es0.file="fm.es0",trait='h3',
+ fixed='Rep',random='Fam',
+ residual=NULL,
+ predict=c('Fam') )
Running Echidna for analysis: h3
Wed Feb 3 22:22:20 2021
Iteration LogL eSigma NEDF
1 1 -2346.93 1576 554
2 2 -2346.84 1590 554
3 3 -2346.84 1589 554
4 4 -2346.84 1589 554
Wed Feb 3 22:22:20 2021 LogL Converged
新用法的示例如下:
// new style
res11b<-echidna(es0.file="fm.es0",
fixed=h3~1+Rep,random=~Fam,
residual=~units,
predict=c('Fam'))
运行过程如下:
// new style
> res11b<-echidna(es0.file="fm.es0",
+ fixed=h3~1+Rep,random=~Fam,
+ residual=~units,
+ predict=c('Fam'))
Running Echidna for analysis: h3
Wed Feb 3 22:24:39 2021
Iteration LogL eSigma NEDF
1 1 -2346.93 1576 554
2 2 -2346.84 1590 554
3 3 -2346.84 1589 554
4 4 -2346.84 1589 554
Wed Feb 3 22:24:39 2021 LogL Converged
今年将陆续完善和更新AFEchidna包。
AFEchidna包最新版:V0.1.0
更新: 2021-02-03
https://blog.sciencenet.cn/blog-1114360-1270478.html
上一篇:
基于植物试验的GBLUP模型之Echidna篇下一篇:
AFEchidna包主函数echidna更新