Studio -server 安装

Step 0 – Prerequisites

On CentOS 7, R is available to be installed using yum via epel package repository, so we need to add it first.

sudo yum install epel-release
sudo yum update

Step 1 – Install R

sudo yum install R -y

Step 2 – Install RStudio Server

Can look for the latest available version here.

wget https://download2.rstudio.org/rstudio-server-rhel-1.1.453-x86_64.rpm
sudo yum install rstudio-server-rhel-1.1.453-x86_64.rpm -y

Step 3 – Start and Log-in into RStudio

sudo systemctl status rstudio-server

In case you’re installing it on a server (no GUI), you can use RStudio via browser, by opening the port RStudio is running on (8787 by default). For a GUI machine, just open the RStudio at http://localhost:8787, the following screen will appear, use the username and password you have used for installing the RStudio (sudo user).

Step 4 – Adding packages from CRAN (Optional)

CRAN stands for Comprehensive R Archive Network, has list of URLs from where R packages can be installed. Available CRAN mirrors.

There are packages which are not entirely written in R, hence may require compilation, for this it is required to install build tools. On CentOS 7 you can do so executing the following single command

sudo yum groupinstall "Development Tools"

It’s a good practice to launch the R console as root user (using sudo) in case of installing a package

sudo -i R

Once you’re inside the R console, now you can install packages – for demo I’ll be installing ‘txtplot’

install.packages('txtplot')

你可能感兴趣的:(Studio -server 安装)