美文网首页
Ubuntu16.04安装R和rstudio

Ubuntu16.04安装R和rstudio

作者: August________ | 来源:发表于2019-11-12 15:58 被阅读0次

    Ubuntu16.04安装R和rstudio

    参考网址:https://cran.rstudio.com/bin/linux/ubuntu/README.html

    安装R

    • 准备环境

      • 至少1GB的RAM
      • 具有sudo特权的非root用户。
    • 修改sources.list文件,添加镜像文件。

    # sudo vim /etc/apt/sources.list
    ####在最后添加
    deb https://<my.favorite.cran.mirror>/bin/linux/ubuntu artful/
    deb https://<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/
    deb https://<my.favorite.cran.mirror>/bin/linux/ubuntu trusty/
    
    
    • 更新镜像并,安装R软件
    # sudo apt-get update
    # sudo apt-get install r-base
    # sudo apt-get install r-base-dev
    
    • 启动R,并进行测试。
    # R
    
    R version 3.6.1 (2019-07-05) -- "Action of the Toes"
    Copyright (C) 2019 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.
    
    > .libPaths()
    [1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library"      
    [3] "/usr/lib/R/library"
    
    
    $ systemctl status rstudio-server
    ● rstudio-server.service - RStudio Server
       Loaded: loaded (/etc/systemd/system/rstudio-server.service; enabled; vendor preset: 
       Active: active (running) since Wed 2019-11-13 22:28:28 CST; 55s ago
      Process: 254414 ExecStart=/usr/lib/rstudio-server/bin/rserver (code=exited, status=0/
     Main PID: 254418 (rserver)
        Tasks: 11
       Memory: 4.7M
          CPU: 618ms
       CGroup: /system.slice/rstudio-server.service
               ├─254418 /usr/lib/rstudio-server/bin/rserver
               ├─254505 /usr/lib/rstudio-server/bin/rserver-monitor --monitor-domain-socket
               ├─254507 nginx: master process /usr/lib/rstudio-server/bin/rserver-htt
               ├─254508 /usr/lib/rstudio-server/bin/rserver-launcher --server-user rstudio-
               ├─254509 /bin/sh -c "/usr/bin/rrdtool" "-"
               ├─254510 /usr/bin/rrdtool -
               └─254511 nginx: worker process                   
    
    Nov 13 22:28:28 cmp2 systemd[1]: Starting RStudio Server...
    Nov 13 22:28:28 cmp2 systemd[1]: Started RStudio Server.
    

    相关文章

      网友评论

          本文标题:Ubuntu16.04安装R和rstudio

          本文链接:https://www.haomeiwen.com/subject/dgrqictx.html