Introduction to R programming

 #Introduction to R programming#

  • In a field of data science to pursue your career you need to have some knowledge about R programming.
  • R is a very easy language compare to other programming languages and scripting languages.

BASICS OF R PROGRAMMING


In this chapter we are going to learn three topics.
  1. HISTORY OF R
  2. HOW TO INSTALL R?
  3. THE R ENVIRONMENT

# HISTORY OF R #

  • R is implementation of S programming language.
  • S is also a Statistical Programming language, Developed by John Chambers, Rick Becker and Allen Wilkes of Bell laboratories.
  • R was created by Ross Ihaka and Robert Gentleman at University of Auckland, New Zealand.
  • Currently R is developed by "R development Team".

# Installing R #

  • All the details of R will be available from CRAN(Comprehensive R Archive Network) on this url: https://cran.r-project.org
  • Go through the link and you will see the home page of CRAN and you can easily download it.

  • This page will be open on CRAN, now you have to select your os type and click on it for example if your os is windows then click on third option shown in the picture.

  • now, you can see the above page click on install for first time.

  • and now you will get a direct download link click on it and your file will be downloaded.
  • here latest version of R will be shown. 
  • double click on downloaded file => press Run => make changes select [no] => select language [English] => [Next] => set path [if you want to change directory] => [Next] => [Next] =>[Next] => [Finish] 
  • Open R (You will see the console window it is called R Console.)
  • by clicking ctrl+l it will remove all the lines from R Console.
  • R console window is a place where you will type and run the commands and you will see that How R works.
  • So this will be the R console but throughout our course we will be working on RStudio only. The reason behind using is RStudio run the commands and you will see how it works and It is easy to use UI(User Interface).

# RStudio #

  • RStudio is a free and open source integrated development environment (IDE) for R, a programming language for statistical computing and graphics.
  • RStudio was founded by JJ Allaire creator of the programming language ColdFusion.
  • RStudio Desktop is a open source licence which can be downloaded from
 https://www.rstudio.com/products/rstudio/download
here are some screen shots.


  • scroll down and select first option free download
  • now you will be redirected on this page...

  • you can see the all installers list, select yr os and click on download link. RStudio will be installed easily.

# The R Environment #

  • R is integrated suite for software facilities for data manipulation, calculation and graphical display.
It has 
  1. Data handling and storage facility
  2. Operator for calculations
  3. Graphical Facilities
  4. Simple & effective Programming language

# R and Statistics #

Many classical and modern statistical techniques have been implemented in form of packages.

  • When we install R, there are some packages that get automatically installed and are called as Base Packages.
  • many more are available from https://CRAN-Project.org

# PACKAGES #

  • R functions & datasets are stored in only packages.
  • only when a package is loaded, contents are available.
  • lets see some commands...
  1. library() => (To see which packages are installed

  2. library(xyz) => (To load a packages package named "xyz")


  3. install.packages(abc) => (To install a package name 'abc')
  4. packages are going to be installed
  5. getwd() => (To view working directory)

  6. setwd() => (To set the working directory)

  7. type setwd("C://Users/Admin/Desktop") and press [alt+Enter] 

  • dependent packages : there are some small packages which we can download in Rstudio.

# R COMMANDS #

  • Technically R is an expression language & is case sensitive.
  • All alphanumeric Symbols are allowed.
  • In assignment Operators, values are not automatic printed.

# WORKING DIRECTION & FILE PATH #

  • TO Refer a file, lets say "abc" stored in some file on my computer, if i want that file to be read in R then we need to specify some path. 
for example. 
D://R Programming//chapter 1//abc.xlsr
  • If we mention directory name, which we call as working directory in R, we mention it by stating "D://R Programming// chapter 1".
  • All the Read and Write Operations will take place in the mentioned folder only.

# GETTING HELP IN R #

  • To get help in R, we use help command. If we want to get help on a command "solve", we use command help(solve).
  • Alternative we can use command ?solve.

# What we have Learnt? #

  • History of R
  • Installing R Programming studio
  • R Environment
    • R commands
    • R Packages
    • Working Direction in R & file path
    • Getting help in R
  • For getting full course free and you will receive a certificate for completing successfully each course..... Comment me and i will send the full course link ....

Comments

Popular posts from this blog

DBMS TUTORIALS

WHAT IS DBMS?

What is Database