Presentation is loading. Please wait.

Presentation is loading. Please wait.

R Brown-Bag Seminar 2.1 Topic: Introduction to R Presenter: Faith Musili F.Musili@cgiar.org ICRAF-Geoscience Lab.

Similar presentations


Presentation on theme: "R Brown-Bag Seminar 2.1 Topic: Introduction to R Presenter: Faith Musili F.Musili@cgiar.org ICRAF-Geoscience Lab."— Presentation transcript:

1 R Brown-Bag Seminar 2.1 Topic: Introduction to R Presenter: Faith Musili ICRAF-Geoscience Lab

2 Objectives Understand R as a programming language.
Install R and R studio Overview of R studio Panels 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 < n [1] 12

5 Install r for windows Go to your browser and search for R windows Choose Download R for Windows Click, Download R 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 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 Libraries\Documents\R\win-library\<old version> and copy everything inside. Paste the above items inside Libraries\Documents\R\win-library\<new version>Restart R studio Write “update.packages()” on the console and execute

10 CONSOLE (Script output panel)
RStudio Data Objects R SCRIPT File ,Plots, Package installation and Help panels CONSOLE (Script output panel)

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 [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) [1]

12 NEXT …............ Installation of packages
Importing different data into r Data manipulation in R


Download ppt "R Brown-Bag Seminar 2.1 Topic: Introduction to R Presenter: Faith Musili F.Musili@cgiar.org ICRAF-Geoscience Lab."

Similar presentations


Ads by Google