在R中,首先安装这几个依赖包,然后再本地安装asreml-R包。
运行下面代码,自动安装依赖包:
name_package = c("data.table","ggplot2","jsonlite")
for(i in seq_along(name_package)){
if(!requireNamespace(name_package[i])){install.packages(name[i])}
}
参考文档
ASReml-R-4-all-OS-Installation-Guide-rpm-deb.pdf
windows
1. 首先你要购买
然后去官网, 下载window的asreml R包
2. 本地安装包
3. 激活
在R中键入代码asreml.license.activate()
, 输入你的key, 然后激活:
4. 测试asrmel4r是否成功
> data(oats)
> oats.asr <- asreml(yield ~ Variety*Nitrogen, random = ~ Blocks/Wplots, data=oats)
Model fitted using the gamma parameterization.
ASReml 4.1.0 Tue Jul 9 17:30:43 2019
LogLik Sigma2 DF wall cpu
1 -216.545 306.164 60 17:30:44 0.0
2 -213.570 256.364 60 17:30:44 0.0
3 -211.053 214.627 60 17:30:44 0.0
4 -209.833 191.511 60 17:30:44 0.0
5 -209.424 180.283 60 17:30:44 0.0
6 -209.379 177.521 60 17:30:44 0.0
7 -209.378 177.095 60 17:30:44 0.0
> plot(oats.asr)
结果:
centos 的安装方法
1. 下载软件包
下载安装包:
asreml_CentOS-7_4.1.0.106.tar.gz
2. 安装软件包
进入服务器, 运行命令:
R CMD INSTALL asreml_CentOS-7_4.1.0.106.tar.gz
[root@ny01 ~]# R CMD INSTALL asreml_CentOS-7_4.1.0.106.tar.gz
* installing to library ‘/opt/microsoft/ropen/3.5.3/lib64/R/library’
* installing *source* package ‘asreml’ ...
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (asreml)
[root@ny01 ~]#
3. 激活软件包
library(asreml)
asreml.license.activate()
Please enter your activation code (RET or 0 to exit)
键入key, 激活即可.
欢迎关注我的公众号:
育种数据分析之放飞自我
。主要分享R语言,Python,育种数据分析,生物统计,数量遗传学,混合线性模型,GWAS和GS相关的知识。