SlideShare ist ein Scribd-Unternehmen logo
1 von 12
R BROWN-BAG SEMINAR 2.1
Topic: Introduction to R
Presenter: Faith Musili
F.Musili@cgiar.org
ICRAF-Geoscience Lab
OBJECTIVES
1. Understand R as a programming language.
2. Install R and R studio
3. Overview of R studio Panels
4. Introduction of R as an object oriented language
ABOUT R AND R STUDIO
R is a free software environment for statistical computing and
graphics. It’s open source and therefore available free of
charge.
R studio is a powerful and productive user interface for R. It's
free and open source, and works great on Windows, Mac, and
Linux.
R is an object oriented programming language where we
create objects and manipulate them as intended. Objects can be
Data frames, vectors, matrices, lists, raw data, spatial objects ,
maps etc.
WHY R LANGUAGE
 R is not just a statistics package, it’s a language(allows you to
specify the performance of new tasks without any limitations)
 R is designed to operate the way that problems are thought about
and has very simple syntax.
 R is both flexible and powerful.
 It is very interactive and thus suitable for data analysis.
• R syntax is very simple and intuitive. For instance,
n <- 10 + 2
n
[1] 12
INSTALL R FOR WINDOWS
Go to your browser and search for R 3.2.4 windows
Choose Download R-3.2.4 for Windows
Click, Download R 3.2.4 for windows (64 megabytes, 32/64
bit )
Then, save the file and run it after download is complete.
Click next in all the popups that appear then finish.
Open the installed r
INSTALL R FOR MAC
Go to your browser and search for R 3.2.4 mac
Choose R for Mac OS X
In the page that opens, click old in the second line
Scroll down the page and choose R-3.2.4.pkg
Then, save the file and run it after download is complete.
Click continue and then install
Open the installed r
INSTALL R STUDIO
 Open browser and search for r studio download
 Choose Download RStudio –RStudio
 Scroll down the page that opens and go to Installers
 Choose the download file according to your operating system
 Save the file and run it after download is complete.
 Click Next and then Finish
Open R studio
UPGRADING R TO A SPECIFIC VERSION
FOR MAC:
• Download and install the new version of R you need.
Go to /Library/frameworks/Rframeworks/versions/<old
version>/Resources/library and copy everything inside.
 Paste the above items inside
/Library/frameworks/Rframeworks/versions/<new
version>/Resources/library
• Restart R studio
• Write “update.packages()” on the console and execute
UPGRADING R TO A SPECIFIC VERSION
FOR Windows:
• Download and install the new version of R you need.
Go to LibrariesDocumentsRwin-library<old version>
and copy everything inside.
 Paste the above items inside
LibrariesDocumentsRwin-library<new
version>Restart R studio
• Write “update.packages()” on the console and execute
RSTUDIO
R SCRIPT
CONSOLE (Script
output panel)
File ,Plots, Package
installation and
Help panels
Data Objects
AS AN OBJECT ORIENTED LANGUAGE
• An object can be created with the “assign” operator which is written as an arrow with a minus sign and a
bracket; this symbol can be oriented left-to-right or the reverse:
n <- 15
n
[1] 15
5 -> n
n
[1] 5
x <- 1
X <- 10
x
[1] 1
X
[1] 10
• If the object already exists, its previous value is erased. The value assigned this way may be the result of an
operation and/or a function.
n<-3+sqrt(10)
n
[1] 6.162278
NEXT …............
Installation of packages
Importing different data into r
Data manipulation in R

Weitere ähnliche Inhalte

Ähnlich wie R Brownbag Seminar 2.1

SessionOne_KnowingRandRStudio
SessionOne_KnowingRandRStudioSessionOne_KnowingRandRStudio
SessionOne_KnowingRandRStudio
Hellen Gakuruh
 

Ähnlich wie R Brownbag Seminar 2.1 (20)

SessionOne_KnowingRandRStudio
SessionOne_KnowingRandRStudioSessionOne_KnowingRandRStudio
SessionOne_KnowingRandRStudio
 
R programming
R programmingR programming
R programming
 
Introduction to r
Introduction to rIntroduction to r
Introduction to r
 
R programming language
R programming languageR programming language
R programming language
 
R programming
R programmingR programming
R programming
 
1 R Tutorial Introduction
1 R Tutorial Introduction1 R Tutorial Introduction
1 R Tutorial Introduction
 
R tutorial
R tutorialR tutorial
R tutorial
 
R studio practical file
R studio  practical file R studio  practical file
R studio practical file
 
Up your data game: How to use R to wrangle, analyze, and visualize data faste...
Up your data game: How to use R to wrangle, analyze, and visualize data faste...Up your data game: How to use R to wrangle, analyze, and visualize data faste...
Up your data game: How to use R to wrangle, analyze, and visualize data faste...
 
R presentation
R presentationR presentation
R presentation
 
R language
R languageR language
R language
 
R_L1-Aug-2022.pptx
R_L1-Aug-2022.pptxR_L1-Aug-2022.pptx
R_L1-Aug-2022.pptx
 
Introduction to R.pptxvvvsjtajtaitsiysyisiysiy
Introduction to R.pptxvvvsjtajtaitsiysyisiysiyIntroduction to R.pptxvvvsjtajtaitsiysyisiysiy
Introduction to R.pptxvvvsjtajtaitsiysyisiysiy
 
Data Science - Part II - Working with R & R studio
Data Science - Part II -  Working with R & R studioData Science - Part II -  Working with R & R studio
Data Science - Part II - Working with R & R studio
 
Reproducible Research in R and R Studio
Reproducible Research in R and R StudioReproducible Research in R and R Studio
Reproducible Research in R and R Studio
 
R programming Language
R programming LanguageR programming Language
R programming Language
 
Introduction to R Programming
Introduction to R ProgrammingIntroduction to R Programming
Introduction to R Programming
 
BUSINESS ANALYTICS WITH R SOFTWARE DIAST
BUSINESS ANALYTICS WITH R SOFTWARE DIASTBUSINESS ANALYTICS WITH R SOFTWARE DIAST
BUSINESS ANALYTICS WITH R SOFTWARE DIAST
 
R programming Language , Rahul Singh
R programming Language , Rahul SinghR programming Language , Rahul Singh
R programming Language , Rahul Singh
 
Predictive Analytics using R
Predictive Analytics using RPredictive Analytics using R
Predictive Analytics using R
 

Kürzlich hochgeladen

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 

Kürzlich hochgeladen (20)

Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 

R Brownbag Seminar 2.1

  • 1. R BROWN-BAG SEMINAR 2.1 Topic: Introduction to R Presenter: Faith Musili F.Musili@cgiar.org ICRAF-Geoscience Lab
  • 2. OBJECTIVES 1. Understand R as a programming language. 2. Install R and R studio 3. Overview of R studio Panels 4. Introduction of R as an object oriented language
  • 3. ABOUT R AND R STUDIO R is a free software environment for statistical computing and graphics. It’s open source and therefore available free of charge. R studio is a powerful and productive user interface for R. It's free and open source, and works great on Windows, Mac, and Linux. R is an object oriented programming language where we create objects and manipulate them as intended. Objects can be Data frames, vectors, matrices, lists, raw data, spatial objects , maps etc.
  • 4. WHY R LANGUAGE  R is not just a statistics package, it’s a language(allows you to specify the performance of new tasks without any limitations)  R is designed to operate the way that problems are thought about and has very simple syntax.  R is both flexible and powerful.  It is very interactive and thus suitable for data analysis. • R syntax is very simple and intuitive. For instance, n <- 10 + 2 n [1] 12
  • 5. INSTALL R FOR WINDOWS Go to your browser and search for R 3.2.4 windows Choose Download R-3.2.4 for Windows Click, Download R 3.2.4 for windows (64 megabytes, 32/64 bit ) Then, save the file and run it after download is complete. Click next in all the popups that appear then finish. Open the installed r
  • 6. INSTALL R FOR MAC Go to your browser and search for R 3.2.4 mac Choose R for Mac OS X In the page that opens, click old in the second line Scroll down the page and choose R-3.2.4.pkg Then, save the file and run it after download is complete. Click continue and then install Open the installed r
  • 7. INSTALL R STUDIO  Open browser and search for r studio download  Choose Download RStudio –RStudio  Scroll down the page that opens and go to Installers  Choose the download file according to your operating system  Save the file and run it after download is complete.  Click Next and then Finish Open R studio
  • 8. UPGRADING R TO A SPECIFIC VERSION FOR MAC: • Download and install the new version of R you need. Go to /Library/frameworks/Rframeworks/versions/<old version>/Resources/library and copy everything inside.  Paste the above items inside /Library/frameworks/Rframeworks/versions/<new version>/Resources/library • Restart R studio • Write “update.packages()” on the console and execute
  • 9. UPGRADING R TO A SPECIFIC VERSION FOR Windows: • Download and install the new version of R you need. Go to LibrariesDocumentsRwin-library<old version> and copy everything inside.  Paste the above items inside LibrariesDocumentsRwin-library<new version>Restart R studio • Write “update.packages()” on the console and execute
  • 10. RSTUDIO R SCRIPT CONSOLE (Script output panel) File ,Plots, Package installation and Help panels Data Objects
  • 11. AS AN OBJECT ORIENTED LANGUAGE • An object can be created with the “assign” operator which is written as an arrow with a minus sign and a bracket; this symbol can be oriented left-to-right or the reverse: n <- 15 n [1] 15 5 -> n n [1] 5 x <- 1 X <- 10 x [1] 1 X [1] 10 • If the object already exists, its previous value is erased. The value assigned this way may be the result of an operation and/or a function. n<-3+sqrt(10) n [1] 6.162278
  • 12. NEXT …............ Installation of packages Importing different data into r Data manipulation in R