R:在Ubuntu14.04 安装R

https://www.digitalocean.com/community/tutorials/how-to-set-up-r-on-ubuntu-14-04

设置APT

$ sudo sh -c 'echo "deb http://cran.rstudio.com/bin/linux/ubuntu trusty/" >> /etc/apt/sources.list'

$ gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9

$ gpg -a --export E084DAB9 | sudo apt-key add -

安装

$ sudo apt-get update

$ sudo apt-get -y install r-base

测试

$ R

R version 3.2.1 (2015-06-18) -- "World-Famous Astronaut"
Copyright (C) 2015 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.

>

退出:

> q(save = "no")

安装package

方式1:

$ R
> install.packages("somepackage")

方式2:

$ sudo su - -c "R -e \"install.packages('shiny', repos = 'http://cran.rstudio.com/')\""

注意repos参数。

测试:

$ R
> library(shiny)

安装devtools包

有些包并不在CRAN中, 可以使用devtools安装。

安装:

$ sudo apt-get -y install libcurl4-gnutls-dev libxml2-dev libssl-dev

$ sudo su - -c "R -e \"install.packages('devtools', repos='http://cran.rstudio.com/')\""

使用devtools从Github中安装package

例如安装shinyjs包:

$ sudo su - -c "R -e \"devtools::install_github('daattali/shinyjs')\""

测试:

$ R
> library(shinyjs)

转载于:https://my.oschina.net/letiantian/blog/614200

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值