SlideShare una empresa de Scribd logo
1 de 33
Descargar para leer sin conexión
R Programming
Sakthi Dasan Sekar
http://shakthydoss.com 1
Introduction to R
R is a programming language developed as an alternative for S
language at AT&T Bell Laboratories by Robert Gentleman and Ross
Ihaka.
Due to its underlying philosophy and design R is incredibly excel in
statistical computation and graphic visualization.
R is free, open source with a very high activity community members.
Available cross all platforms (Linux, Mac, Windows)
http://shakthydoss.com 2
Introduction to R
R is much more than just its core language. It has a worldwide
repository system, the Comprehensive R Archive Network (CRAN)
http://cran.r-project.org
As of 2011, there were more than 3,000 such packages hosted on CRAN
and numerous more on other sites
http://shakthydoss.com 3
Introduction to R
Cons of R Language
R has a steep learning curve.
Working with large datasets is limited by RAM size.
http://shakthydoss.com 4
Introduction to R
Who use R in their business
http://shakthydoss.com 5
Introduction to R
Understanding of R language
• R Statement or Commands can be separated by a semicolon (;) or a newline.
• Assignment operator in R is "<-" (although "=" also works).
• All characters after # are treated as comments.
• There is not multi line or block level Comments.
• $ (dollar) operator in R is an analogous to .(dot) operator in other languages.
Student$name
Student$age
http://shakthydoss.com 6
Introduction to R
Installing R
Installing from CRAN (Comprehensive R Network)
Website: http://cran.r-project.org/
R is actively being improved all the time, Make sure that you choose
recent version to install.
http://shakthydoss.com 7
Introduction to R
Installing R in windows
For Windows and Mac OS X, one can simply download a self-installing binary.
For Linux, installation varies.
For the Debian distribution (including Ubuntu), R system can be installed using the regular
package-management tools.
Since R is open source, one can also compile and install it using the source code.
http://shakthydoss.com 8
Introduction to R
Installing R in windows
Window R package can be downloaded from
https://cran.r-project.org/bin/windows/base/
Download R 3.X.X for Windows executable file (.exe)
http://shakthydoss.com 9
Introduction to R
Click Next in the Setup Wizard.
You can leave to setting to default.
http://shakthydoss.com 10
Introduction to R
Open R Console (Rgui from your desktop) R Console
http://shakthydoss.com 11
Introduction to R
IDE for R
The RStudio project currently provides most of the desired features for
an IDE in a novel way, making it easier and more productive to use R.
The RStudio program can be run on the desktop or through a web
browser.
The desktop version is available for Windows, Mac OS X, and Linux
platforms.
http://shakthydoss.com 12
Introduction to R
Notable IDEs for R
Name Platforms
ESS Windows, Mac, Linux
Eclipse Windows, Mac, Linux
SciViews Windows, Mac, Linux
JGR Windows, Mac, Linux
Tinn-R Windows
Notepad++ Windows
Rgui Windows
http://shakthydoss.com 13
Introduction to R
Installing RStudio is usually a straightforward process.
For Windows and Mac OS X, one can simply download a self-installing binary.
For Linux, installation varies.
For the Debian distribution (including Ubuntu), RStudio can be installed using
the regular package-management tools.
http://shakthydoss.com 14
Introduction to R
Installing RStudio in windows.
https://www.rstudio.com/products/rstudio/download/
Download Rstudio.
Run the installation file.
http://shakthydoss.com 15
Introduction to R
Open RStudio
Source Panel
R console
Environment
Panel
File/Package
Panel
http://shakthydoss.com 16
Introduction to R
R workspace
When R is started, it follows this process
R is started in the working directory (aka workspace).
If present, the .Rprofile file’s commands are executed.
If present, the .Rdata file is loaded.
http://shakthydoss.com 17
Introduction to R
R workspace
R stores user-defined objects in workspace.
At the end of an R session, the user can save an snapshot of the current
workspace and reloaded automatically next time when R is started.
getwd() - return working directory
setwd() - set working directory
http://shakthydoss.com 18
Introduction to R
In RStudio you can set the workspace by Tools -> Global Options
http://shakthydoss.com 19
Introduction to R
• There are over 1,000 functions at the core of R, and new R functions are created all of the time.
• Each R function comes with its own help page, which you can access by typing the function’s name after
question mark
Getting Help
help.start() # Load HTML help pages into browser
help(package) # List help page for "package"
?package # Shortform for "help(package)"
help.search("keyword") # Search help pages for "keyword"
?help # For more options
help(package=base) # List tasks in package "base"
http://shakthydoss.com 20
Introduction to R
Packages
• Many Data Scientist programmers and statisticians , use R to design tools that can help people analyze data. Many of these
people contribute their code as preassembled collections of functions and objects called packages.
• Each R package is hosted at http://cran.r-project.org
• Not all packages are loaded by default, but can be load / install on demand
library() # List available packages to load
library("package") # loads the package
library(help="package") # list package contents
detach("package:pkg") # Unload the loaded package "pkg"
install.packages(“package") # Install the package
http://shakthydoss.com 21
Introduction to R
Installing package by GUI RStudio -> Tools -> Install Packages
Check the package to load
http://shakthydoss.com 22
Introduction to R
Knowledge Check
http://shakthydoss.com 23
Introduction to R
Which of the statement is TRUE.
A. R is a propitiatory general purpose language
B. R excels in statically computation and graphic capabilities.
C. R syntax are very similar to assembly language.
D. R has no GUI
Answer B
http://shakthydoss.com 24
Introduction to R
Which of the statement is TRUE.
A. Working with large datasets is limited by RAM size.
B. R language is own by AT&T Bell Labs
C. R available only for Unix platfroms
D. R language is design for parallel programming and horizontally scalable systems.
Answer A
http://shakthydoss.com 25
Introduction to R
What is CRAN stands for
A. Comprehensive R Network
B. Computational R Network
C. Comprehensive R Archive Network
D. Computational R Archive Network
Answer C
http://shakthydoss.com 26
Introduction to R
Which not an IDE for R language
A. RStudio
B. RGUI
C. Tinn-R
D. Dreamweaver
Answer D
http://shakthydoss.com 27
Introduction to R
When R is started.
A. It loads .Rprofile and .Rdata from workspace
B. It attempts loads only .Rdata from workspace
C. It attempts loads only .Rprofile from workspace
D. Does nothing
Answer A
http://shakthydoss.com 28
Introduction to R
Function getwd() - return working directory
A. TRUE
B. FALSE
Answer A
http://shakthydoss.com 29
Introduction to R
Function setwd() - set working directory
A. TRUE
B. FALSE
Answer A
http://shakthydoss.com 30
Introduction to R
How to browser for all help documents in R
A. help.start()
B. help(help)
C. library()
D. install.packages(help)
Answer A
http://shakthydoss.com 31
Introduction to R
How to install new packages in R.
A. Install(“package”)
B. library(“package”)
C. install.packages("package")
D. load(“package”)
Answer C
http://shakthydoss.com 32
Introduction to R
How to load a installed package.
A. load("package")
B. library("package")
C. install.packages("package")
D. library()
Answer B
http://shakthydoss.com 33

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
Unit 1 - R Programming (Part 2).pptx
Unit 1 - R Programming (Part 2).pptxUnit 1 - R Programming (Part 2).pptx
Unit 1 - R Programming (Part 2).pptx
 
R Language Introduction
R Language IntroductionR Language Introduction
R Language Introduction
 
Introduction to R - from Rstudio to ggplot
Introduction to R - from Rstudio to ggplotIntroduction to R - from Rstudio to ggplot
Introduction to R - from Rstudio to ggplot
 
Step By Step Guide to Learn R
Step By Step Guide to Learn RStep By Step Guide to Learn R
Step By Step Guide to Learn R
 
R Programming Language
R Programming LanguageR Programming Language
R Programming Language
 
R programming slides
R  programming slidesR  programming slides
R programming slides
 
R programming Fundamentals
R programming  FundamentalsR programming  Fundamentals
R programming Fundamentals
 
Programming in R
Programming in RProgramming in R
Programming in R
 
Introduction to Rstudio
Introduction to RstudioIntroduction to Rstudio
Introduction to Rstudio
 
R language tutorial
R language tutorialR language tutorial
R language tutorial
 
R programming
R programmingR programming
R programming
 
Class ppt intro to r
Class ppt intro to rClass ppt intro to r
Class ppt intro to r
 
Data Management in R
Data Management in RData Management in R
Data Management in R
 
Introduction to R programming
Introduction to R programmingIntroduction to R programming
Introduction to R programming
 
Data analytics with R
Data analytics with RData analytics with R
Data analytics with R
 
R programming Language
R programming LanguageR programming Language
R programming Language
 
R programming
R programmingR programming
R programming
 
Loops and functions in r
Loops and functions in rLoops and functions in r
Loops and functions in r
 
Introduction to data analysis using R
Introduction to data analysis using RIntroduction to data analysis using R
Introduction to data analysis using R
 

Destacado

R programming Basic & Advanced
R programming Basic & AdvancedR programming Basic & Advanced
R programming Basic & AdvancedSohom Ghosh
 
R Introduction
R IntroductionR Introduction
R Introductionschamber
 
Presentation R basic teaching module
Presentation R basic teaching modulePresentation R basic teaching module
Presentation R basic teaching moduleSander Timmer
 
Data Science Academy Student Demo day--Divyanka Sharma, Businesses in nyc
Data Science Academy Student Demo day--Divyanka Sharma, Businesses in nycData Science Academy Student Demo day--Divyanka Sharma, Businesses in nyc
Data Science Academy Student Demo day--Divyanka Sharma, Businesses in nycVivian S. Zhang
 
Introduction to the R Statistical Computing Environment
Introduction to the R Statistical Computing EnvironmentIntroduction to the R Statistical Computing Environment
Introduction to the R Statistical Computing Environmentizahn
 
Introduction to R for Data Science :: Session 7 [Multiple Linear Regression i...
Introduction to R for Data Science :: Session 7 [Multiple Linear Regression i...Introduction to R for Data Science :: Session 7 [Multiple Linear Regression i...
Introduction to R for Data Science :: Session 7 [Multiple Linear Regression i...Goran S. Milovanovic
 
Why R? A Brief Introduction to the Open Source Statistics Platform
Why R? A Brief Introduction to the Open Source Statistics PlatformWhy R? A Brief Introduction to the Open Source Statistics Platform
Why R? A Brief Introduction to the Open Source Statistics PlatformSyracuse University
 
Quantitative analysis using SPSS
Quantitative analysis using SPSSQuantitative analysis using SPSS
Quantitative analysis using SPSSAlaa Sadik
 
Basics Of SAS Programming Language
Basics Of SAS Programming LanguageBasics Of SAS Programming Language
Basics Of SAS Programming Languageguest2160992
 

Destacado (20)

R tutorial
R tutorialR tutorial
R tutorial
 
R programming Basic & Advanced
R programming Basic & AdvancedR programming Basic & Advanced
R programming Basic & Advanced
 
Seefeld stats r_bio
Seefeld stats r_bioSeefeld stats r_bio
Seefeld stats r_bio
 
Using r
Using rUsing r
Using r
 
R presentation
R presentationR presentation
R presentation
 
Rtutorial
RtutorialRtutorial
Rtutorial
 
Using R For Statistics
Using R For StatisticsUsing R For Statistics
Using R For Statistics
 
R Introduction
R IntroductionR Introduction
R Introduction
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
Bayesian models in r
Bayesian models in rBayesian models in r
Bayesian models in r
 
Presentation R basic teaching module
Presentation R basic teaching modulePresentation R basic teaching module
Presentation R basic teaching module
 
Data Science Academy Student Demo day--Divyanka Sharma, Businesses in nyc
Data Science Academy Student Demo day--Divyanka Sharma, Businesses in nycData Science Academy Student Demo day--Divyanka Sharma, Businesses in nyc
Data Science Academy Student Demo day--Divyanka Sharma, Businesses in nyc
 
Introduction to the R Statistical Computing Environment
Introduction to the R Statistical Computing EnvironmentIntroduction to the R Statistical Computing Environment
Introduction to the R Statistical Computing Environment
 
Introduction to R for Data Science :: Session 7 [Multiple Linear Regression i...
Introduction to R for Data Science :: Session 7 [Multiple Linear Regression i...Introduction to R for Data Science :: Session 7 [Multiple Linear Regression i...
Introduction to R for Data Science :: Session 7 [Multiple Linear Regression i...
 
R- Introduction
R- IntroductionR- Introduction
R- Introduction
 
Minitab 17
Minitab 17Minitab 17
Minitab 17
 
Why R? A Brief Introduction to the Open Source Statistics Platform
Why R? A Brief Introduction to the Open Source Statistics PlatformWhy R? A Brief Introduction to the Open Source Statistics Platform
Why R? A Brief Introduction to the Open Source Statistics Platform
 
Non Parametric Tests
Non Parametric TestsNon Parametric Tests
Non Parametric Tests
 
Quantitative analysis using SPSS
Quantitative analysis using SPSSQuantitative analysis using SPSS
Quantitative analysis using SPSS
 
Basics Of SAS Programming Language
Basics Of SAS Programming LanguageBasics Of SAS Programming Language
Basics Of SAS Programming Language
 

Similar a 1 R Tutorial Introduction

Introducing Revolution R Open: Enhanced, Open Source R distribution from Revo...
Introducing Revolution R Open: Enhanced, Open Source R distribution from Revo...Introducing Revolution R Open: Enhanced, Open Source R distribution from Revo...
Introducing Revolution R Open: Enhanced, Open Source R distribution from Revo...Revolution Analytics
 
Rapid miner r extension 5
Rapid miner r extension 5Rapid miner r extension 5
Rapid miner r extension 5raz3366
 
R as supporting tool for analytics and simulation
R as supporting tool for analytics and simulationR as supporting tool for analytics and simulation
R as supporting tool for analytics and simulationAlvaro Gil
 
BUSINESS ANALYTICS WITH R SOFTWARE DIAST
BUSINESS ANALYTICS WITH R SOFTWARE DIASTBUSINESS ANALYTICS WITH R SOFTWARE DIAST
BUSINESS ANALYTICS WITH R SOFTWARE DIASTHaritikaChhatwal1
 
A Handbook Of Statistical Analyses Using R
A Handbook Of Statistical Analyses Using RA Handbook Of Statistical Analyses Using R
A Handbook Of Statistical Analyses Using RNicole Adams
 
Introduction to R and Installation.pptx
Introduction  to R and Installation.pptxIntroduction  to R and Installation.pptx
Introduction to R and Installation.pptxDhanshyam Mahavadi
 
Introduction to R Programming
Introduction to R ProgrammingIntroduction to R Programming
Introduction to R Programminghemasri56
 
R programming presentation
R programming presentationR programming presentation
R programming presentationAkshat Sharma
 

Similar a 1 R Tutorial Introduction (20)

R presentation
R presentationR presentation
R presentation
 
Introducing Revolution R Open: Enhanced, Open Source R distribution from Revo...
Introducing Revolution R Open: Enhanced, Open Source R distribution from Revo...Introducing Revolution R Open: Enhanced, Open Source R distribution from Revo...
Introducing Revolution R Open: Enhanced, Open Source R distribution from Revo...
 
Rapid miner r extension 5
Rapid miner r extension 5Rapid miner r extension 5
Rapid miner r extension 5
 
R as supporting tool for analytics and simulation
R as supporting tool for analytics and simulationR as supporting tool for analytics and simulation
R as supporting tool for analytics and simulation
 
BUSINESS ANALYTICS WITH R SOFTWARE DIAST
BUSINESS ANALYTICS WITH R SOFTWARE DIASTBUSINESS ANALYTICS WITH R SOFTWARE DIAST
BUSINESS ANALYTICS WITH R SOFTWARE DIAST
 
Introduction to statistical software R
Introduction to statistical software RIntroduction to statistical software R
Introduction to statistical software R
 
R Brownbag Seminar 2.1
R Brownbag Seminar 2.1R Brownbag Seminar 2.1
R Brownbag Seminar 2.1
 
A Handbook Of Statistical Analyses Using R
A Handbook Of Statistical Analyses Using RA Handbook Of Statistical Analyses Using R
A Handbook Of Statistical Analyses Using R
 
R_L1-Aug-2022.pptx
R_L1-Aug-2022.pptxR_L1-Aug-2022.pptx
R_L1-Aug-2022.pptx
 
Introduction to R and Installation.pptx
Introduction  to R and Installation.pptxIntroduction  to R and Installation.pptx
Introduction to R and Installation.pptx
 
R language
R languageR language
R language
 
Garishma xcs
Garishma xcsGarishma xcs
Garishma xcs
 
RStudio
RStudioRStudio
RStudio
 
R Studio (Report)
R Studio (Report)R Studio (Report)
R Studio (Report)
 
Introduction to R Programming
Introduction to R ProgrammingIntroduction to R Programming
Introduction to R Programming
 
R ext world/ useR! Kiev
R ext world/ useR!  KievR ext world/ useR!  Kiev
R ext world/ useR! Kiev
 
R programming presentation
R programming presentationR programming presentation
R programming presentation
 
R development
R developmentR development
R development
 
Introduction to R software, by Leire ibaibarriaga
Introduction to R software, by Leire ibaibarriaga Introduction to R software, by Leire ibaibarriaga
Introduction to R software, by Leire ibaibarriaga
 
R programming
R programmingR programming
R programming
 

Último

Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Valters Lauzums
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...amitlee9823
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...amitlee9823
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...amitlee9823
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceDelhi Call girls
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...amitlee9823
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...only4webmaster01
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsJoseMangaJr1
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% SecurePooja Nehwal
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -Pooja Nehwal
 

Último (20)

Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter Lessons
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
 

1 R Tutorial Introduction

  • 1. R Programming Sakthi Dasan Sekar http://shakthydoss.com 1
  • 2. Introduction to R R is a programming language developed as an alternative for S language at AT&T Bell Laboratories by Robert Gentleman and Ross Ihaka. Due to its underlying philosophy and design R is incredibly excel in statistical computation and graphic visualization. R is free, open source with a very high activity community members. Available cross all platforms (Linux, Mac, Windows) http://shakthydoss.com 2
  • 3. Introduction to R R is much more than just its core language. It has a worldwide repository system, the Comprehensive R Archive Network (CRAN) http://cran.r-project.org As of 2011, there were more than 3,000 such packages hosted on CRAN and numerous more on other sites http://shakthydoss.com 3
  • 4. Introduction to R Cons of R Language R has a steep learning curve. Working with large datasets is limited by RAM size. http://shakthydoss.com 4
  • 5. Introduction to R Who use R in their business http://shakthydoss.com 5
  • 6. Introduction to R Understanding of R language • R Statement or Commands can be separated by a semicolon (;) or a newline. • Assignment operator in R is "<-" (although "=" also works). • All characters after # are treated as comments. • There is not multi line or block level Comments. • $ (dollar) operator in R is an analogous to .(dot) operator in other languages. Student$name Student$age http://shakthydoss.com 6
  • 7. Introduction to R Installing R Installing from CRAN (Comprehensive R Network) Website: http://cran.r-project.org/ R is actively being improved all the time, Make sure that you choose recent version to install. http://shakthydoss.com 7
  • 8. Introduction to R Installing R in windows For Windows and Mac OS X, one can simply download a self-installing binary. For Linux, installation varies. For the Debian distribution (including Ubuntu), R system can be installed using the regular package-management tools. Since R is open source, one can also compile and install it using the source code. http://shakthydoss.com 8
  • 9. Introduction to R Installing R in windows Window R package can be downloaded from https://cran.r-project.org/bin/windows/base/ Download R 3.X.X for Windows executable file (.exe) http://shakthydoss.com 9
  • 10. Introduction to R Click Next in the Setup Wizard. You can leave to setting to default. http://shakthydoss.com 10
  • 11. Introduction to R Open R Console (Rgui from your desktop) R Console http://shakthydoss.com 11
  • 12. Introduction to R IDE for R The RStudio project currently provides most of the desired features for an IDE in a novel way, making it easier and more productive to use R. The RStudio program can be run on the desktop or through a web browser. The desktop version is available for Windows, Mac OS X, and Linux platforms. http://shakthydoss.com 12
  • 13. Introduction to R Notable IDEs for R Name Platforms ESS Windows, Mac, Linux Eclipse Windows, Mac, Linux SciViews Windows, Mac, Linux JGR Windows, Mac, Linux Tinn-R Windows Notepad++ Windows Rgui Windows http://shakthydoss.com 13
  • 14. Introduction to R Installing RStudio is usually a straightforward process. For Windows and Mac OS X, one can simply download a self-installing binary. For Linux, installation varies. For the Debian distribution (including Ubuntu), RStudio can be installed using the regular package-management tools. http://shakthydoss.com 14
  • 15. Introduction to R Installing RStudio in windows. https://www.rstudio.com/products/rstudio/download/ Download Rstudio. Run the installation file. http://shakthydoss.com 15
  • 16. Introduction to R Open RStudio Source Panel R console Environment Panel File/Package Panel http://shakthydoss.com 16
  • 17. Introduction to R R workspace When R is started, it follows this process R is started in the working directory (aka workspace). If present, the .Rprofile file’s commands are executed. If present, the .Rdata file is loaded. http://shakthydoss.com 17
  • 18. Introduction to R R workspace R stores user-defined objects in workspace. At the end of an R session, the user can save an snapshot of the current workspace and reloaded automatically next time when R is started. getwd() - return working directory setwd() - set working directory http://shakthydoss.com 18
  • 19. Introduction to R In RStudio you can set the workspace by Tools -> Global Options http://shakthydoss.com 19
  • 20. Introduction to R • There are over 1,000 functions at the core of R, and new R functions are created all of the time. • Each R function comes with its own help page, which you can access by typing the function’s name after question mark Getting Help help.start() # Load HTML help pages into browser help(package) # List help page for "package" ?package # Shortform for "help(package)" help.search("keyword") # Search help pages for "keyword" ?help # For more options help(package=base) # List tasks in package "base" http://shakthydoss.com 20
  • 21. Introduction to R Packages • Many Data Scientist programmers and statisticians , use R to design tools that can help people analyze data. Many of these people contribute their code as preassembled collections of functions and objects called packages. • Each R package is hosted at http://cran.r-project.org • Not all packages are loaded by default, but can be load / install on demand library() # List available packages to load library("package") # loads the package library(help="package") # list package contents detach("package:pkg") # Unload the loaded package "pkg" install.packages(“package") # Install the package http://shakthydoss.com 21
  • 22. Introduction to R Installing package by GUI RStudio -> Tools -> Install Packages Check the package to load http://shakthydoss.com 22
  • 23. Introduction to R Knowledge Check http://shakthydoss.com 23
  • 24. Introduction to R Which of the statement is TRUE. A. R is a propitiatory general purpose language B. R excels in statically computation and graphic capabilities. C. R syntax are very similar to assembly language. D. R has no GUI Answer B http://shakthydoss.com 24
  • 25. Introduction to R Which of the statement is TRUE. A. Working with large datasets is limited by RAM size. B. R language is own by AT&T Bell Labs C. R available only for Unix platfroms D. R language is design for parallel programming and horizontally scalable systems. Answer A http://shakthydoss.com 25
  • 26. Introduction to R What is CRAN stands for A. Comprehensive R Network B. Computational R Network C. Comprehensive R Archive Network D. Computational R Archive Network Answer C http://shakthydoss.com 26
  • 27. Introduction to R Which not an IDE for R language A. RStudio B. RGUI C. Tinn-R D. Dreamweaver Answer D http://shakthydoss.com 27
  • 28. Introduction to R When R is started. A. It loads .Rprofile and .Rdata from workspace B. It attempts loads only .Rdata from workspace C. It attempts loads only .Rprofile from workspace D. Does nothing Answer A http://shakthydoss.com 28
  • 29. Introduction to R Function getwd() - return working directory A. TRUE B. FALSE Answer A http://shakthydoss.com 29
  • 30. Introduction to R Function setwd() - set working directory A. TRUE B. FALSE Answer A http://shakthydoss.com 30
  • 31. Introduction to R How to browser for all help documents in R A. help.start() B. help(help) C. library() D. install.packages(help) Answer A http://shakthydoss.com 31
  • 32. Introduction to R How to install new packages in R. A. Install(“package”) B. library(“package”) C. install.packages("package") D. load(“package”) Answer C http://shakthydoss.com 32
  • 33. Introduction to R How to load a installed package. A. load("package") B. library("package") C. install.packages("package") D. library() Answer B http://shakthydoss.com 33