1 / 5

Programming in R

Programming in R. Harry R Erwin, PhD CIS308 Faculty of Applied Sciences University of Sunderland. Resources. The Website has links to three programming tutorials. http://zoonek2.free.fr/UNIX/48_R/02.html is accessible.

sheri
Download Presentation

Programming in R

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. Programming in R Harry R Erwin, PhD CIS308 Faculty of Applied Sciences University of Sunderland

  2. Resources • The Website has links to three programming tutorials. • http://zoonek2.free.fr/UNIX/48_R/02.html is accessible. • http://cran.r-project.org/doc/manuals/R-intro.html provides examples to work through. • Lumley’s course http://faculty.washington.edu/tlumley/Rcourse/ is also good. • Work through the tutorial you find easiest.

  3. What is R? • Statisticians use R to analyze data stored in objects that look like spreadsheets—data frames. You can think of R as spreadsheet scripting on steroids. • R is a functional language like Lisp, Python, or OCaML. (See http://en.wikipedia.org/wiki/Functional_programming.) • Specifically, functions in functional languages lack side-effects. • Eternal Flame by Bob Kanefsky and sung by Julia Ecklar (about Lisp, another functional language):

  4. Learning R • Start R • We will work through some examples of R code from chapters 1 and 6 and Appendix E of Verzani’sUsing R for Introductory Statistics. • Afterwards, we’ll dip into the Zoonek programming tutorial (the second one). It has a bit more depth.

  5. Use a Notes File • Open a new document and type the following into it: • # Notes • mean(rnorm(10)) • # To execute a selection in Windows, select it and type ctrl-R. • # In Mac OS, do the same, but type cmd-return instead. • # To source the entire edit file, use ctrl-E or cmd-E. • # The Windows FAQ is here: http://cran.r-project.org/bin/windows/base/rw-FAQ.html • Try ctrl-R on the contents and look at your command window. • I will now demonstrate a number of features of R. Take good notes!

More Related