yzhlinscau的个人博客分享 http://blog.sciencenet.cn/u/yzhlinscau

博文

AFEchidna包更新代码!

已有 1203 次阅读 2021-2-3 22:36 |个人分类:Echidna|系统分类:科研笔记

这几天对主函数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://wap.sciencenet.cn/blog-1114360-1270478.html

上一篇:基于植物试验的GBLUP模型之Echidna篇
下一篇:AFEchidna包主函数echidna更新
收藏 IP: 219.137.67.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-3-28 17:07

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部