SlideShare a Scribd company logo
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

More Related Content

Similar to R Brownbag Seminar 2.1

SessionOne_KnowingRandRStudio
SessionOne_KnowingRandRStudioSessionOne_KnowingRandRStudio
SessionOne_KnowingRandRStudioHellen Gakuruh
 
R programming
R programmingR programming
R programming
Shantanu Patil
 
Introduction to r
Introduction to rIntroduction to r
Introduction to r
gslicraf
 
R programming language
R programming languageR programming language
R programming language
Keerti Verma
 
R programming
R programmingR programming
R programming
Pooja Sharma
 
1 R Tutorial Introduction
1 R Tutorial Introduction1 R Tutorial Introduction
1 R Tutorial Introduction
Sakthi Dasans
 
R tutorial
R tutorialR tutorial
R studio practical file
R studio  practical file R studio  practical file
R studio practical file
Ketan Khaira
 
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...
Charles Guedenet
 
R presentation
R presentationR presentation
R presentation
ShwetDadhaniya1
 
R language
R languageR language
R language
Kìshør Krîßh
 
R_L1-Aug-2022.pptx
R_L1-Aug-2022.pptxR_L1-Aug-2022.pptx
R_L1-Aug-2022.pptx
ShantilalBhayal1
 
Introduction to R.pptxvvvsjtajtaitsiysyisiysiy
Introduction to R.pptxvvvsjtajtaitsiysyisiysiyIntroduction to R.pptxvvvsjtajtaitsiysyisiysiy
Introduction to R.pptxvvvsjtajtaitsiysyisiysiy
PrernaKhera3
 
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
Derek Kane
 
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
Susan Johnston
 
R programming Language
R programming LanguageR programming Language
R programming Language
SarthakBhargava7
 
Introduction to R Programming
Introduction to R ProgrammingIntroduction to R Programming
Introduction to R Programming
hemasri56
 
BUSINESS ANALYTICS WITH R SOFTWARE DIAST
BUSINESS ANALYTICS WITH R SOFTWARE DIASTBUSINESS ANALYTICS WITH R SOFTWARE DIAST
BUSINESS ANALYTICS WITH R SOFTWARE DIAST
HaritikaChhatwal1
 
R programming Language , Rahul Singh
R programming Language , Rahul SinghR programming Language , Rahul Singh
R programming Language , Rahul Singh
Ravi Basil
 
Predictive Analytics using R
Predictive Analytics using RPredictive Analytics using R
Predictive Analytics using R
Bhaskara Reddy Sannapureddy
 

Similar to 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
 

Recently uploaded

Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
abdulrafaychaudhry
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Yara Milbes
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 

Recently uploaded (20)

Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 

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