1 / 30

Introduction to

Introduction to. >. Biodiversity Informatics Training Workshop Boulder, CO. What is R. Open source interpreted programming language and development environment Initially release in 1993 Influenced by the S programming language Focus on statistics, data analysis & graphics

kerri
Download Presentation

Introduction to

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to > Biodiversity Informatics Training Workshop Boulder, CO

  2. What is R • Open source interpreted programming language and development environment • Initially release in 1993 • Influenced by the S programming language • Focus on statistics, data analysis & graphics • Extensible via user contributed packages

  3. Why R? • Reproducible, Repeatable Therefore a perfect tool for science • Method to track data and analytic flow Therefore a perfect tool for scientists

  4. Why Open?

  5. R & QGIS Integration {dismo}, {rgdal}, {rVertnet} • GetData • Prepare • Filter • Subset • Analyse • Model • Map Data • Derive surfaces • Subset • Create visuals Rasters: GeoTiff, .ASC, .BIL, Vectors: Shapefiles

  6. Getting • www.r-project.org • Available for Windows, Macintosh, Linux & as Source Code • Current release (14 June 2013): R 3.0.1

  7. RGui

  8. Object-based functional language • What that means to users: Commands have three parts: arguments, body and its environment. A function is invoked by its name, followed by arguments, which can be named, positional or have defaults if omitted myvariable <- read.table(x, file = ”data.csv”, sep = ”,”)

  9. Objects • Used to store values • Case sensitive • Named with alphanumeric characters • Cannot start with a number • Persistent until reassigned or removed from objects list. User rm(obj_name) to remove. • Values can be assigned to variables via <- or = • Use objects() orls() to view list of objects in the current environment.

  10. Getting Help • ?fxn or help(fxn) > ?round

  11. Extending R • Via user-created packages available from repositories • CRAN (Comprehensive R Archive Network) • Bioconductor

  12. Installing and using Packages • Over 4,600 packages available. • Package: maps • Draw lines and polygons as specified by a map database. • Package: mapproj • Converts latitude and longitude into projected coordinates. Required by maps package, if we want to use projections other than default (rectangular). • Package: maptools • Set of tools for manipulating and reading geographic data, in particular ESRI shapefiles. Also installs package sp. • Package: sp • A package providing classes and methods for spatial data: points, lines, polygons and grids

  13. Using Packages Rectangular projection Bonne equal-area projection

  14. U.S. Census State Boundaries Results fromGeoreferencing

  15. Filtering Data StateProvince==“Missouri” Use logical operators in filter expression: ==, >, <, <=, >=, <>

  16. Editing records in your data frame or

  17. FishNet 2 Collaborative Georeferencing Project • http://geolocate.fishnet2.net/workflow.html

  18. More Information http://cran.r-project.org/doc/manuals/R-intro.pdf

  19. for Loops Syntax: for (name in expr1) expr2

  20. Breaking out of Loops next can be used to discontinue the rest of a particular cycle and skip to the next iteration in the loop

  21. while Loops Syntax: while (condition) expr

  22. repeat Loops Syntax: repeat expr Expression is repeated until break is called

More Related