2016-04-29



Image source: pixabay.com

What is R-Studio?

If you want to know what R-Studio is then first you need to know what is R.

R is a programming language or software environment that is installed in your computer for scientific computing and graphics

R-Studio is an Integrated Development Environment (IDE) which integrates with R to perform further  functions of R.

Lets learn about R-Studio in detail

R-Studio is a set of integrated tools designed to help you to use R more productively. It was founded in the year 2008.

R-Studio is a code editor with very good features that will make code development easy in R. R-Studio lets R to run in a more user friendly environment.

R-Studio has a help desk and it supports R in a very practical way

R-Studio is free of charge to download in Linux, Windows and Apple IOS devices.

One can use R without R-Studio with any other editor to write the scripts. But R-Studio cannot be used more effectively without R.

Objectives of R-Studio

Help users to be more productive with R programming

Provides a statistical computing environment for the open source software R

Makes the user to analyze the data with R more easily

How to install R

Follow these simple steps to install R in your computer

Download the R installer at http://cran.stat.ucla.edu

Install R by opening the installer

Now it is all set to run R from your local computer

How to install R-Studio

R-Studio download is easy. Follow the below steps

Go to R-Studio download

Click the download R-Studio desktop button

Select the installation file for your computer

Run the installation file

Features of R-Studio

R-Studio is  available in open source and commercial editions on the desktop of Windows, Mac and Linux or in a browser connected to R-Studio server or R-Studio server Pro.

The important features of R-Studio are listed below

Code highlighting option that highlights keywords and variables in different colours

Automatic bracket matching

Code completion – you don’t have to type all the commands in full

Smart indentation

Execute R code directly from the source editor

Integrates the tools with R into a single environment

Quick access to function and parameters of functions

Enables easy navigation to files and functions

Integrated R help and documentation

Integrated support for Git and subversions

Supports HTML, PDF, Word documents and slide shows

Manages multiple working directories

Workspace browser and data viewer

Supports interactive graphics with Shiny and ggvis

Interactive debugging function to fix errors and issues quickly

Easy exploration of variables and values

Package development tools

Configuring R-Studio

If your R-Studio does not recognize the R installed in your computer then you can set which R version to use by selecting

Tools à Options à Options Pane à Change

You can change between the 32 bit R installation and 64 bit R installation. The default is 32 bit. You can also choose any specific version of R by choosing the browse option.

In the Options pane you can also modify the behaviour of R in R-Studio.

The default options for R in R-Studio is explained below

Initial working directory – You can set the default working directory which R will use as a startup

Save Option – R-Studio asks whether you want to save the workspace when you quit. You will be provided with options like Ask, Never or Always

Restore option – You can select this check box if you want R-Studio to automatically restore your workspace at startup

History – Select this option if you want R-Studio to save the history when you exit. You can also save the history in a single global file

Duplicate entries – R-Studio automatically removes duplicate entries from your history if you select this option

Comprehensive R Archive Network (CRAN) mirror – Select this option to set the CRAN mirror site that R-Studio uses to install new packages

R-Studio Screen

Once R-Studio starts select

File à New à R Script

You have four main areas

R Scripts and Data view

R Script is where you keep a record of the file.

To start with R Script select File à New à R Script

or

Press Ctrl + Shift + N

The top left corner of the screen has a text editor which allows you to work with source script files. You can enter multiple lines of  code and do other tasks on your script.

This code editor works like every other code editor. It is a smart code editor which highlights various elements of your code.

Console

In the bottom left corner of the screen you find the console option. The console in R-Studio is similar to the console in RGui. This is the place where R-Studio interacts with R. Here you can type commands and see the output

Workspace tab

Workspace tab is located in the top right corner of the R-Studio screen. The workspace tab stores any object, value, function or anything you create using R. You can also inspect the variables you created in R session.

History tab

This tab maintains a record of all the previous commands which will be helpful to you while testing and running processes. You can select the whole list or select a particular command and send it to R Script to keep a track of your work

Working directory

Every time you open R-Studio it reaches a default directory. You can change the default to a folder using Tools à Options menu.

The other options are as follows

Files

The files option will help you to search the files and folders on your system

Plots

Plots tab will display the charts and graphs. If there are more than one graph to be displayed then it will display all the graphs as icons. In order to extract the graph, Click on the Export option where you can save the file as an image or in PDF format. This option will be useful to you when you want to share the graph or use it in any other document. You can copy the graph to the clipboard and then paste it directly into your destination document.

This tab also lets you display 3D graphs. You cannot save such graphs but you can take a screenshot of the graph and paste it in your document.

Packages tab

This tab shows the list of all the Add-ons installed in RStudio. Package means self contained set of codes that defines functionality to R. You can also add new Add-ons by clicking on the ‘Install Packages’ icon, then write the name on the add-on in the pop-up menu and click the Install button.

Help tab

This tab will let you browse the built in help system of R.

R-Studio Desktop Open Source

The features of RStudio desktop in Open Source edition are listed below

It is free to download and use

The license required is AGPL v3

Easy Access to RStudio locally

Syntax highlighting

Code completion

Smart indentation

Execute R code directly from the source editor

Manages multiple working directories

Integrated R help and documentation

Special package development tools

It offers support community forums only

R-Studio Desktop Commercial edition

The features of RStudio Desktop commercial license includes all the features of R-Studio Desktop plus the below mentioned features

Offers a commercial license for organizations who are not able to use AGPL software

Gives access to priority support

Supports email

8 hours response during the working hours of business

R-Studio has separate RStudio License agreement

It is not free of cost. It is available for an annual subscription

R-Studio Server Open Source

RStudio Server has the following characteristics

It is accessed through a web browser and is free of cost

Move computation close to the data

Scale, compute and RAM centrally

Supports Community forums only

AGPL v3 is the license required

R-Studio Server Commercial License

It contains all the features of open source plus the following

Administrative tools

Enhanced security and Authentication

Metrics and Monitoring

Enhanced resource management

It is available for a yearly subscription

When RStudio Commercial version is compared with R-Studio open source it has a lot of additional features and advantages.

The administrative tools of R-Studio Server commercial edition includes the following activities

Manage active sessions and resource utilization

Assume control and terminate sessions

Set user limits on system resources

Enhanced Security and authentication includes the following

LDAP, Active directory, Google accounts

Supports Pluggable authentication modules and Kerberos through PAM

Custom authentication through proxied HTTP header

Encrypt traffic using SSL

Metrics and monitoring includes the following

Historical statistics

Audit of server performance and resource utilization

Checks with configurable output

Sends metrics to external systems with Graphite plain text protocol

Advanced Resource Management

Limit resources for users and group

Tailor the version of R

Reserve CPU

Prioritize scheduling

Provision accounts and Mount home directories dynamically

Execute per user profile scripts for database automatically

R-Studio Server Pro

RStudio Server Pro provides security, resource management, metrics and commercial data support services to R.

RStudio helps you to do the following activities

Manage the R resources – Lets multiple users to share the resources. Users can effectively install and configure the R environment

Access R code securely – RStudio Server Pro lets the users to access to the R workspace from any system and from any location

Increase R productivity – RStudio Server Pro helps the team to be more productive with R. It helps to prioritize the resources according to the individuals or groups. Allows the admin to help the individual users when they are in need of any help

Connect the current systems – RStudio Server Pro helps to integrate with IT reports and data management products

Developing packages with R-Studio

RStudio has a variety of tools that supplies codes to many R packages with ease and creates innovative work in many fields. Few of the packages of R are listed below for reference

R markdown – lets you insert R code into a markdown document. It helps in automated reporting

Shiny – Easily makes interactive web apps with R

knitr – It is a report generating package that combines R with Tex, Markdown or HTML

ggplot2 – This is a famous package of R which helps you to make beautiful graphics

tidyr – These are tools to change the layout of your data sets. Tidy data is data that is easy to work with in R.

readr – Makes it easy to read the data in the table format

lubridate – This package makes it easier to work with dates and times

devtools – Contains a set of tools that could convert your code into an R package

magrittr – Offers a process for chaining commands with new forward pipe operator

packrat – It is a management tool which makes your project more transferable and reproducible

stringr – This package offers tools for learning about regular expressions and character strings

dplyr – It offers quick data manipulation and offers shortcuts for sub-setting, summarizing and joining data sets.

haven – Allows you to load foreign data formats into R

Leaflet – It is a famous Java Script library for interactive maps

DT – It provides an R interface to the Java Script library Data Tables where data is displayed as tables in HTML pages with all the major features of the tables.

roxygen2 – Documentation being the important part of good code, this offers a quick and easy way to document your R packages. It converts inline code comments into documentation pages

testthat – Offers a easy way to write unit tests for your code projects. It makes the testing activity more interesting.

htmlwidgets – Offers a fast way to build Java Script based visualizations with R

The post Getting Started with R-Studio - For Dummies appeared first on eduCBA.

Show more