What is RStudio?
RStudio IDE is an open source integrated Development Environment for the statistical analysis program R.
RStudio Server gives a web version of RStudio IDE which grants easy development on a VPS.
Installing RStudio In a VPS
Install ‘R’, ‘apparmor’, and ‘gdebi’
sudo apt-get install r-base libapparmor1 gdebi-core
Now, download and install the right package for your architecture. On a 32-bit Ubuntu, run the following commands.
wget http://download2.rstudio.org/rstudio-server-0.97.336-i386.deb -O rstudio.deb
For Ubuntu 64-bit, run the following commands.
wget http://download2.rstudio.org/rstudio-server-0.97.336-amd64.deb -O rstudio.deb
Install the Package.
sudo gdebi rstudio.deb
Creating RStudio User
It is not recommended to use the root account with RStudio, instead, it is better to simply create a normal user account for RStudio. You can give the account any name you wish, and the account password will be the one you will be using in the web interface.
sudo adduser rstudio
RStudio is going to use the user’s home directory as its default workspace.
Using R Studio
RStudio can be accessed from port 8787. Every user is accessible with a password in RStudio.
Confirm that RStudio is working correctly by installing a quantitative finance package from CRAN, the R package repository.
Execute the following command within RStudio to install quantmod.
Now, verify RStudio’s graphing capabilities by plotting the stock price of Apple. The graph will show up in the bottom right panel of RStudio.
library('quantmod') data <- new.env() getSymbols('AAPL', data) plot(data$AAPL)
R is quite powerful and there are many useful packages available from CRAN.
You may learn the basics of R at Try R.