Introduction to2012-09-21 @HSPH
Kazuki Yoshida, M.D. MPH-CLE student
Menu
n What is R?
n How does it compare to others?
n What are the advantages/disadvantages of R?
n Let’s install R.
n Editors and GUIs: How to make R more friendly
is
a language and
environment for statistical computing and graphics
http://www.r-project.org/about.html
Menu
n What is R?
n How does it compare to others?
n What are the advantages/disadvantages of R?
n Let’s install R.
n Editors and GUIs: How to make R more friendly
Many statisticalpackages
Software
Cost$65/yr
(+Parallels&Windows)
$179 Free for you None $55/yr
Mode of use Commands Menus or commands Menus Commands
(or menus)Menus (or commands)
Prevalence at HSPH
Very prevalent
esp. in Epi
Moderately prevalent esp in Bio
Seasonal cases in
June
Rel. rare. Incidence
increasing?
Rare. More prevalent in
wild
SAS Stata JMP SPSSR
Other packagesn CDC Epi Info: Field epidemiology
n TreeAgePro: Decision science
n SUDAAN: Survey data
n WinBUGS: Markov chain Monte Carlo
n Python: General-purpose programming language
n matlab, mathematica: Mathematics
Courses taught in R
n BIO 232 (Fall) Stat Methods I
n BIO 509 (Fall) Intro Stat Comp Environments
n BIO 503 (Winter) Program and Stat Model in R
n ID 271 (Spring) Adv Regression for Env Epi
n HMS BMI713.0 (Fall) Comp Stat for Biomed Scihttp://informaticstraining.hms.harvard.edu/content/lectures-and-problem-sets
http://isites.harvard.edu/icb/icb.do?keyword=k84377
Menu
n What is R?
n How does it compare to others?
n What are the advantages/disadvantages of R?
n Let’s install R.
n Editors and GUIs: How to make R more friendly
Advantages
is
Free as in free beer
http://en.wikipedia.org/wiki/Free_Beer
is
Free as in freedom
http://www.thefreedomtrail.org
http://chereemoore.blogspot.com/2011/06/live-free-or-die.html
People care about free
is
Developed by
& user community
Core Developer Team:Douglas Bates, John Chambers, Peter Dalgaard, Seth Falcon, Robert Gentleman (Left), Kurt Hornik, Stefano Iacus, Ross Ihaka (Right), Friedrich Leisch, Uwe Ligges, Thomas Lumley, Martin Maechler, Duncan Murdoch, Paul Murrell, Martyn Plummer, Brian Ripley, Deepayan Sarkar, Duncan Temple Lang, Luke Tierney, Simon Urbanek
http://www.nytimes.com/2009/01/07/technology/business-computing/07program.html?pagewanted=all
Robert Gentleman Ross Ihaka
http://r4stats.com/articles/popularity/
4000+contributed
packages
Fast development
http://www.stat.auckland.ac.nz/~paul/RG2e/ http://cran.r-project.org/web/packages/wordcloud/index.html
http://had.co.nz/ggplot2/
Flexible Graphics
http://www.r-bloggers.com/u-s-unemployment-data-animated-choropleth-maps/
pROC survival/rms
Watchadditional
on-site demo
http://www.stat.auckland.ac.nz/~paul/RG2e/chapter16.html
http://cran.r-project.org/web/packages/animation/index.html
Disadvantages
L
Learninga new
languageis hard
R Commander:http://socserv.mcmaster.ca/jfox/Misc/Rcmdr/
EZR: http://www.jichi.ac.jp/saitama-sct/SaitamaHP.files/statmedEN.html
Lack of standard
GUIDeducer:
http://www.deducer.org/
Lack of variable labeling
Use memisc for partial fix
NHANES3 dataset
http://newscenter.berkeley.edu/2012/03/29/nsf-big-data-grant/
Not great for big data (yet)
Use ff, bigmemory, etc
http://techreport.com/articles.x/15818
Single core use
Turn on parallelization explicitly
Menu
n What is R?
n How does it compare to others?
n What are the advantages/disadvantages of R?
n Let’s install R.
n Editors and GUIs: How to make R more friendly
Let’s get started!!
Download!!http://www.r-project.org
http://rstudio.org
GUI toolkit
OR
Install!!
Follow on-site instruction
Menu
n What is R?
n How does it compare to others?
n What are the advantages/disadvantages of R?
n Let’s install R.
n Editors and GUIs: How to make R more friendly
Comparison of environments
Standalone R.app
Fully functional Poor editor
ESS on emacs editor
Fully functional emacs is hard
http://ess.r-project.org
Deducer GUI
Easy dialogues Very limited functionality
http://www.deducer.org
R Commander GUI
More functional Less sophisticated
http://socserv.mcmaster.ca/jfox/Misc/Rcmdr/
EZR modification of R Commander GUI
Focus on medical research Still in early development
http://www.jichi.ac.jp/saitama-sct/SaitamaHP.files/statmedEN.html
For Your Information
websitesn Download: http://www.r-project.org
n Look for packages: http://cran.r-project.org/web/views/
n Look up abbreviations.: http://www.r-bloggers.com/abbreviations-of-r-commands-explained-250-r-abbreviations/
n Get up-to-date info: http://www.r-bloggers.com
editors
n RStudio: http://www.rstudio.org
n ESS for emacs: http://ess.r-project.org
GUI
n R Commander: http://socserv.mcmaster.ca/jfox/Misc/Rcmdr/
n EZR: http://www.jichi.ac.jp/saitama-sct/SaitamaHP.files/statmedEN.html
n Deducer: http://www.deducer.org/
n Rattle: http://rattle.togaware.com