This document provides an overview and introduction to R and R Studio. It outlines the objectives of understanding R as a programming language, installing R and R Studio, and an introduction to R as an object-oriented language. Instructions are provided on installing R for Windows and Mac as well as installing R Studio. An overview of the R Studio interface is given along with details on upgrading R to a specific version. The document concludes with information on R as an object-oriented language and creating and manipulating objects.
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
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
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