18
The possibilities R endless HMSC Tech Talk November 3 rd , 2014 Nick Sard [email protected]

Sard HMSC Tech Talk

Embed Size (px)

DESCRIPTION

I gave a tech talk at the Hatfield Marine Science Center on how cool R (the programming language) is and what you can do with it.

Citation preview

Page 1: Sard HMSC Tech Talk

The possibilities R endless

HMSC Tech TalkNovember 3rd, 2014Nick Sard

[email protected]

Page 2: Sard HMSC Tech Talk

R is open-source, versatile, & powerful• Open-source

– Inspect and change code written by others– Reproducible research

• Versatile– Simulate data– Statistical analysis– Create functions to process data– Create many types of graphics– Interface with websites

• Powerful– Can integrate with “The Cloud”

• Oregon State University– Center for Genomic Research and Bioinformatics

Page 3: Sard HMSC Tech Talk

Many different types of people use R

Page 4: Sard HMSC Tech Talk

R is used by many well known companies

http://www.nytimes.com/2009/01/07/technology/business-computing/07program.html?pagewanted=all&_r=0

Page 5: Sard HMSC Tech Talk

Learning R might helpincrease your income

http://blog.revolutionanalytics.com/2014/02/r-salary-surveys.html

Page 6: Sard HMSC Tech Talk

R is la lingua statistica

• T-test, ANOVA, Linear regression

• GLM – poisson, neg. bin., zero-inflated, logit

• Mixed-effect models

• Bayesian statistics

• But there is so much more it can do…

http://lh6.ggpht.com/_njskKyfiNvo/TZqYIJwbALI/AAAAAAAAA3s/FealNiZLF8U/image_thumb%5B13%5D.png?imgmax=800

Page 7: Sard HMSC Tech Talk

Libraries are always expanding R’s capabilities

• Freely use libraries– >30,000 functions in R

– Improve/modify code

• Make your own library– Collection of functions

– Share with community

Page 8: Sard HMSC Tech Talk

The number of R packages are growing exponentially!

http://r4stats.com/articles/popularity/

Page 9: Sard HMSC Tech Talk

The number of R packages are growing exponentially!

http://r4stats.com/articles/popularity/

Page 10: Sard HMSC Tech Talk

The top ten downloaded R

libraries

http://had.co.nz/

Page 11: Sard HMSC Tech Talk

Before we get started with a demo…

Page 12: Sard HMSC Tech Talk

The standard R GUI is plain and hard to work with

Use R Studio instead ;)

Page 13: Sard HMSC Tech Talk

R Studio makes using R easier• Integrated development environment (IDE)

– Highlights syntax– Completes code (using tab)– Automatic indentation for functions– Ingrates with documentation– Easy to make and save figures– Links to GitHub

• Data backup• Work on code in collaborative groups

• Let’s take a quick tour

Page 14: Sard HMSC Tech Talk

R Studio layout – can be personalized

Code

Console

Files, plots, packages, & help

Workspace, Github, & more

Page 15: Sard HMSC Tech Talk

Graphics in more detail• Focus on libraries (not base graphics)

– ggplot2 created by Hadley Wickham - http://docs.ggplot2.org/current/ • gg short for Grammar of Graphics• Versatile and powerful graphics

– Maps -http://gis.stackexchange.com/questions/48828/how-to-make-beautiful-maps-in-r• ArcMap alternative

– Rgl - http://casoilresource.lawr.ucdavis.edu/drupal/book/export/html/371• 3D graphics

– Shiny - http://rstudio.github.io/shiny/tutorial/#welcome• Makes interactive graphics on the web

– Shiny_rgl – example: https://github.com/muschellij2/shiny-sandbox • Create 3D web graphics

– Plot.ly• More interactive web based graphics: • http://zevross.com/blog/2014/09/10/quickly-create-online-and-interactive-plots-using-plot-ly/

Page 16: Sard HMSC Tech Talk

Reproducible research

Page 17: Sard HMSC Tech Talk

Get stuck? Don’t worry! R has an active community to help you!

Page 18: Sard HMSC Tech Talk

Thanks!

• The code in the demo can be found here:

http://rpubs.com/nicksard/HMSC_tech_talk

• The slides for this PowerPoint can be found here:

http://www.slideshare.net/nicksard/sard-hmsc-tech-talk