1 / 8

Introduction to R

Introduction to R. Clay Ford, StatLab. September 11/12, 2013. Research Data Services. Research Data Services: http://www.library.virginia.edu/services / Data management planning GIS training and consultations Locating data, sharing and archiving data StatLab Services:

varick
Télécharger la présentation

Introduction to 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. Introduction to R Clay Ford, StatLab September 11/12, 2013

  2. Research Data Services • Research Data Services: • http://www.library.virginia.edu/services/ • Data management planning • GIS training and consultations • Locating data, sharing and archiving data • StatLab Services: • http://statlab.library.virginia.edu/ • Individual consulting: advice, training, feedback on quantitative research • Workshops on statistical methods and techniques

  3. Introducing R • The facts: • R is a language and environment for statistical computing and graphics • Freely available and maintained by volunteers • R is extensible; can be expanded by installing “packages” • How to get it: • http://www.r-project.org/ (or Google “Download R”) • Available for Windows, Mac, Linux • Free to install, no catches • Also highly recommended: • R Studio: a free IDE for R • http://www.rstudio.com/ • If you install R and R Studio, then you only need to run R Studio

  4. Using R • R is command-line driven (very little point-and-click) • You use “functions” to work with data • Most analyses require writing a script, which is sourced into the R console • R Studio makes this process easier • What’s so special about R? • Free • Over 4000 packages that add functionality (about 25 come with R) • Produces nice print-ready graphics • Open-source (you can see how it does what it does) • Easy to install and non-invasive

  5. Assumptions, Goals, Expectations • Assumptions • No experience with R • Familiarity with basic statistical concepts • Goals • Get you comfortable enough to start using R • Give you with example code you can use and resources to learn more • Expectations • You will not learn R in a 90 minute workshop • You must use R to learn R

  6. Workshop Plan • If you have R and R Studio installed, please do the following: • Download R script (the file with .R extension): • Go to http://statlab.library.virginia.edu/ • Go to Workshop Descriptions under Workshop Schedule • Go to Introduction to R section and click “Download materials for the workshop” • Download the file with a .R extension (may need to right click and “Save Link As…”) • Open R Studio only (do not need to open R) • Open R script in R Studio. File…Open File… • Follow along with presentation • Let’s go use R!

  7. Tips and Reminders • R is case-sensitive • Comment your code so you remember what it does; comments are preceded with # • R scripts are simply text files with a .R extension • Use Ctrl + R to submit code • Use the Tab key to let R/R Studio finish typing commands for you • Use Shift + down arrow to highlight lines or blocks of code • In R Studio: Ctrl + 1 and Ctrl + 2 switches between script and console • Use up and down arrows to cycle through previous commands in console • Don’t be afraid of errors; you won’t break R • If you get stuck, Google is your friend

  8. Resources • Google • Web sites • UCLA IDRE: http://www.ats.ucla.edu/stat/r/ • Quick-R: http://www.statmethods.net/ • Rtips: http://pj.freefaculty.org/R/Rtips.html • Reference card: http://cran.r-project.org/doc/contrib/Baggott-refcard-v2.pdf • Books • R Cookbook (Paul Teetor) • R in a Nutshell (Joseph Adler) • Coursera Classes • Computing for Data Analysis (Sept 23, 4 weeks) • Data Analysis (Oct 28, 8 weeks)

More Related