您好,欢迎来到伴沃教育。
搜索
您的当前位置:首页【r<-安装】从源安装R3.5 (Ubuntu 18.04

【r<-安装】从源安装R3.5 (Ubuntu 18.04

来源:伴沃教育
# 安装依赖
$ sudo apt-get install xorg-dev libreadline-dev
$ sudo apt-get install libcurl4-openssl-dev
$ sudo apt-get install texinfo texlive
$ wget http://mirrors.ctan.org/fonts/inconsolata.zip
$ sudo cp -Rfp inconsolata/* /usr/share/texmf/
$ # 或者 sudo cp -r inconsolata/ /usr/share/texlive/texmf-dist/tex/latex/
$ sudo mktexlsr # 刷新

# 如果没有java解释器,安装下
$ sudo apt-get install default-jdk

# 下载与安装R
$ curl -O http://cran.utstat.utoronto.ca/src/base/R-3/R-3.5.0.tar.gz
$ tar -zxvf R-3.5.0.tar.gz
$ cd R-3.5.0/
$ ./configure --prefix=$HOME/local/R --enable-R-shlib
$ make
$ make install

# 创建符号链接
$ cd /usr/bin/
$ sudo ln -s $HOME/local/R/bin/Rscript Rscript
$ sudo ln -s $HOME/local/R/bin/R R

# 检查
$ ls -l R*
lrwxrwxrwx 1 root root 23 6月  28 17:01 R -> /home/wsx/local/R/bin/R
lrwxrwxrwx 1 root root 29 6月  28 17:01 Rscript -> /home/wsx/local/R/bin/Rscript

# 使用
$ R

R version 3.5.0 (2018-04-23) -- "Joy in Playing"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> 

遇到编译问题和报错,可以参考下面两篇博文:

自定义修改提示符,比如在.Rprofile中添加:

options(prompt="ℝ> ")

Copyright © 2019- bangwoyixia.com 版权所有 湘ICP备2023022004号-2

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务