Getting Started With R - First Hands On

Working with R:

R is a case-sensitive language. It differentiates between X and x . As X is capital letter while x is small letter.

We are writing program in Console window. Here , you are doing simple calculation as :

There is a disadvantage of R Console , we cannot save program codes in file . So , we can use more user friendly tool , the IDE ( Integrated Development Environment) for R i.e. Rstudio for coding and storing programs.

Working with Rstudio :

When we open Rstudio , it looks like -

Image result for rstudio images blank

We have three windows :

First window shows Console . Here , we can write and execute programs simultaneously.

Second window is upper right. It shows Environment and History window.

Third window is lower right. It shows Files , Plots , Packages, Help and Viewer windows.

We open a new window , called Script window.

For opening a Script window, click on File tab on upper left corner of Rstudio . Then , click on New File and click on R Script. It will look like -

 

Before writing your first program in Rstudio , we will see how to use Help. Type help() and pres ctrl +R(control + R) to run program. You can also use ctrl+Enter to run the program.

help()

When we execute the code , it shows in console window to execute.

It will open Help window in bottom right window.

It helps us to find help in functions for programming.

 

Another code :-

help.start()

By running this code, it opens Help window .It shows introduction of R.

 

Simple Calcluations in R 

 

You can do simple calculation . Write this code in Script window -

1+1

Output will be shown in Console window:-

[1] 2

Similarly , you can do other calculations as-

2*5

Output -

[1]  10

Using Assignment Operator in R

 

We have use assignment operator as "<-"  & "=" .

Objects :

It is used to store the values . We can create object by assigning values to object.

a<-1

In this program , we create an object named "a" , which store value 1.We are using assignment operator(<-) to assign value to object. We can see "a" object in Environment window. The object a stores 1.

Adding Comments in R

It is added to make program easier to understand . We can add comments by adding "#". It is non-executable code ( it is not execute by R).

You can check writing a comment !

Here , # object  a creation is a comment . It gives explanation of our code.

Programming basic constraints :

We have two phases while running the program. It is compilation and execution.

Computer only reads binary form . When we run a program, first the program converts into machine understandable language in form of binary(0 or 1) source file. The process is called compilation.  After compilation , the binary file is loaded into computer memory for execution .

Every code written in script window is compile and execute . But comments are ignored in compilation and execution.

 

We can store an object like this also -

b<-1 + 1  

It will store 2.

To check "b" object value , we run this code-

b

It displays this output in console window -

[1] 2

 

We can remove objects from Environment window. We can do it by using rm() :-

rm(a)

You can checkout Environment window. There is no object "a" stored in it.

c()

We can combine multiple values in an object by using c() .

x<-c(1,2)

It creates x object , which stores 1 and 2.

 

Contact at TJT@TechnicalJockey.com , if you are looking for an Instructor Based Online Training !

Comments

There are no entries yet.
Please enter the code
* Required fields

Subscribe to our mailing list

* indicates required

Looking for Corporate Training ? Reach out to us at Akriti.Lal@instrovate.com

Reach out to us if you are looking for Corporate Training to Build The Next Generation Analytical Workforce with an in-depth understanding of  Exploratory Data Analysis , Data Visualisation, Data Analytics , AI First , Machine Learning & Deep Learning Training & Consulting helping them to take Data Informed Decision at each stage of the business. 

We understand that At the present times , the Entire Industry is in a Tranformation stage with the Softwares  being rebuilt with Artificial Intelligence Capabilities .

We need SMART WORKFORCE for the SMART SOFTWARES to reap the maximum return . 

 

Whatsapp at +91-9953805788 or email at - akriti.lal@instrovate.com if you would like to know more . 

 

  • Corporate Tableau Training in Gurgaon
  • Corporate Data Analytics Training in Gurgaon
  • Corporate Microsoft Power BI Training in Gurgaon
  • Corporate Microstrategy Training in Gurgaon
  • Corporate Google Data Studio Training in Gurgaon
  • Corporate Python Training in Gurgaon
  • Corporate Advance Analytics in R Programming Training in Gurgaon
  • Corporate Machine Learning Training in Gurgaon
  • Corporate Deep Learning Training in Gurgaon
  • Corporate Data Visualization Training in Gurgaon

 

Address

Instrovate Technologies

Noida, Gurgaon

 

akriti.lal@instrovate.com 

Hit Your Refresh Button To Rise Higher
Print Print | Sitemap
All rights reserved @ Instrovate Technologies
GSTIN : 09AAECI6862K1Z1

Terms Of Services    Privacy Policy    Disclaimer     Refund Policy    


Call

E-mail