APrimerOn R Tutorial

Embed Size (px)

Citation preview

  • 8/9/2019 APrimerOn R Tutorial

    1/47

    Introduction to R

    (a tutorial)

    Gerardo Soto-Campos, PhD

    Modeling Health

    www.modelinghealth.com

    http://www.modelinghealth.com/http://www.modelinghealth.com/
  • 8/9/2019 APrimerOn R Tutorial

    2/47

    PART I

    The Basics

    Modeling Health, LLC 2

  • 8/9/2019 APrimerOn R Tutorial

    3/47

    What is R?

    R is an inexpensive, well maintained, free, andbeautiful language to do statistical programmingand graphics.Actually it is more than that. It is the way of doing statistics

    for the future.

    It can be used to build whole modeling and simulationenvironments.

    R is the good-twin of S and S-Plus, an expensive

    program developed at Bell Labs by Becker,Chambers, and Wilks. One day, when you know R well, read Chambers book

    (Chamber 2008)

    Modeling Health, LLC

    3

  • 8/9/2019 APrimerOn R Tutorial

    4/47

    R expected to take over the data world by2015 true/false?...

    RA Muenchen in theblog r4stats.com

    Predicts R taking over

    SAS by 2015:http://r4stats.com/articles/popularity/

    Plot of # of paperspublished in R, Stata,SAS, SPSS, and S-Plus

    Modeling Health, LLC 4

    http://r4stats.com/articles/popularity/http://r4stats.com/articles/popularity/http://r4stats.com/articles/popularity/http://r4stats.com/articles/popularity/http://r4stats.com/articles/popularity/
  • 8/9/2019 APrimerOn R Tutorial

    5/47

    How to get R

    Download it from the R project site:

    http://www.r-project.org/

    It works in any platform: Windows, Mac and Linux.

    Mexico has two mirrors at: ITAM: http:

    http://cran.itam.mx/

    Colegio de Postgraduados de Texcoco:

    http://www.est.colpos.mx/R-mirror/

    * Si trabajamos duro podria haber uno mas en Pachuca Hgo.

    Modeling Health, LLC 5

    http://www.r-project.org/http://cran.itam.mx/http://www.est.colpos.mx/R-mirror/http://www.est.colpos.mx/R-mirror/http://www.est.colpos.mx/R-mirror/http://www.est.colpos.mx/R-mirror/http://www.est.colpos.mx/R-mirror/http://www.est.colpos.mx/R-mirror/http://cran.itam.mx/http://www.r-project.org/http://www.r-project.org/http://www.r-project.org/http://www.r-project.org/http://www.r-project.org/
  • 8/9/2019 APrimerOn R Tutorial

    6/47

    R IDE, decent but there is better

    Modeling Health, LLC 6

  • 8/9/2019 APrimerOn R Tutorial

    7/47

    Better integrated development environments (IDEs) to run

    R: Rstudio, Eclipse, Emacs, Revolution Analytics

    Modeling Health, LLC 7

    Rstudio http://rstudio.org/ (easy to configure, one of my favorites)

    Eclipse http://eclipse.org/ (Requires StatET plugging, the favorite

    among computer nerds, it also supports java, python, C++,not too easy to configure)

    Emacs http://www.gnu.org/software/emacs/ (an old and ugly classic.

    I neither use it nor like it)

    Revolution Analytics R http://www.revolutionanalytics.com/(a commercial version of

    R, excellent packages to handle BIG data, smart people, lotsof webcasts, great service, free for academics)

    http://rstudio.org/http://eclipse.org/http://www.gnu.org/software/emacs/http://www.revolutionanalytics.com/http://www.revolutionanalytics.com/http://www.revolutionanalytics.com/http://www.gnu.org/software/emacs/http://www.gnu.org/software/emacs/http://eclipse.org/http://eclipse.org/http://rstudio.org/http://rstudio.org/
  • 8/9/2019 APrimerOn R Tutorial

    8/47

    Two more things

    The bioinformatics community has a specific softwarewritten in R called Bioconductor: http://www.bioconductor.org/

    Bioconductor is specific for genomics, and can be use to run in

    the Amazon cloud Bioconductor can also be run as an R package called from

    Rstudio using standard R.

    Revolution Analytics R Revolution Analytics has a standard version of R, called

    Revolution R. It is free and can be ran from RStudio or thestandard R GUI

    Revolution Enterprise costs money, it has a great GUI, and

    excellent packages. It can be customized to run in the cloud. Modeling Health, LLC

    8

    http://www.bioconductor.org/http://www.bioconductor.org/http://www.bioconductor.org/
  • 8/9/2019 APrimerOn R Tutorial

    9/47

    Most of this deck will deal with RStudio

    www.rstudio.org

    Download andinstall it for linux,

    Mac or windows In windows is

    extremely easy toconfigure

    In linux is not soeasy to configure:

    Ask CARLOS

    Modeling Health, LLC 9

  • 8/9/2019 APrimerOn R Tutorial

    10/47

    A session on R in RStudio

    Open Rstudio

    In the Rstudio menu go to Project -> NewProject

    Say New Directory I chose C:/Users/jerry/R2.13.0/Rdemo/primerOnR/tutorialOnR

    Modeling Health, LLC 10

  • 8/9/2019 APrimerOn R Tutorial

    11/47

    Parts of the R session in RStudio

    Console It is the working horse of Rstudio

    Use it to test things you dont care to loose

    In general it is not a good idea to develop code in the console

    R Scripts Go to File -> New -> R Script -> Save As -> aScriptName.R

    I call it Rtutorial.R

    Comments are coded with symbol: #

    Modeling Health, LLC 11

  • 8/9/2019 APrimerOn R Tutorial

    12/47

    R objects and data structures

    Everything in R is anobject in the sense ofobject orientedprograming

    Data Types Double- Integer Complex Logical Factors Character Missing data

    Data Structures Numbers Vectors Matrices

    Lists Data.frames Strings

    IMPORTANT R is case sensitive

    Modeling Health, LLC 12

  • 8/9/2019 APrimerOn R Tutorial

    13/47

    R Help

    In the console enter:

    help(aDataStructure):

    help(vector)

    help(matrix)

    help(factor)

    Useful reference cardfor R:

    http://cran.r-

    project.org/doc/contrib/Short-refcard.pdf

    Modeling Health, LLC 13

    http://cran.r-project.org/doc/contrib/Short-refcard.pdfhttp://cran.r-project.org/doc/contrib/Short-refcard.pdfhttp://cran.r-project.org/doc/contrib/Short-refcard.pdfhttp://cran.r-project.org/doc/contrib/Short-refcard.pdfhttp://cran.r-project.org/doc/contrib/Short-refcard.pdfhttp://cran.r-project.org/doc/contrib/Short-refcard.pdfhttp://cran.r-project.org/doc/contrib/Short-refcard.pdfhttp://cran.r-project.org/doc/contrib/Short-refcard.pdfhttp://cran.r-project.org/doc/contrib/Short-refcard.pdfhttp://cran.r-project.org/doc/contrib/Short-refcard.pdf
  • 8/9/2019 APrimerOn R Tutorial

    14/47

    Working Directory, Image, and History

    Creating projects in RStudio directly sets the workingdirectory In the console type

    getwd()

    To set the working directory from the console: setwd(aDirctoryPath)

    Image Binary containing all the objects defined in an R session

    save.image(. RTutorialImage) #at the end of the session

    load.image(.RTutorialImage) # at the beginning of the session

    History save.history(.RTutorialHistory) #at the end of session

    load.history(. RTutorialHistory) #at the start of session

    Modeling Health, LLC 14

  • 8/9/2019 APrimerOn R Tutorial

    15/47

    Vectors

    In the script type:

    vec1

  • 8/9/2019 APrimerOn R Tutorial

    16/47

    Matrices: algebra of matrices remains

    mat1

  • 8/9/2019 APrimerOn R Tutorial

    17/47

    Factors

    Factors are useful variables in R taking on a limitednumber of values called levels.

    Useful for statistical modeling

    Example data=c(1,2,2,3,1,2,3,3,1,2,3,3,1) ; as.factor(data) [1] 1 2 2 3 1 2 3 3 1 2 3 3 1

    Levels: 1 2 3

    summary(as.factor(data)) # summary of data as factors

    1 2 3

    4 4 5

    Modeling Health, LLC 17

    M d li H l h LLC 18

  • 8/9/2019 APrimerOn R Tutorial

    18/47

    Lists

    This is a veryversatile and important data structure Very useful in modeling and simulation

    Technically a list is a recursive vector.

    You can save any object in a list. Example agent

  • 8/9/2019 APrimerOn R Tutorial

    19/47

    data.frames

    A list with a column vector on each column (see Matloff)

    Useful structures to manipulate information with objectsfrom different classes.

    Example

    df1

  • 8/9/2019 APrimerOn R Tutorial

    20/47

    Strings

    Knowing how to handle character strings is useful whenprogramming.

    Commands grep("character",c("Knowing"," how"," to"," handle"," character","

    strings"," is"," useful")).

    paste("Knowing how to handle character strings is useful whenprogramming")

    substr("Knowing how to handle character strings is useful whenprogramming",1,7)

    nchar("Knowing how to handle character strings is useful whenprogramming")

    Modeling Health, LLC 20

    M d li H lth LLC 21

  • 8/9/2019 APrimerOn R Tutorial

    21/47

    Dates and Times

    as.Date('1960-7-21')

    as.Date('1/30/2012',format='%m/%d/%Y')

    Modeling Health, LLC 21

    Modeling Health LLC 22

  • 8/9/2019 APrimerOn R Tutorial

    22/47

    Input I

    To do anything interesting with R we need to know how to readand write data into and out of it.

    Reading CSV files

    Example with data from the National Health and Nutrition Survey 03-

    04 (NHANES 03-04) http://www.cdc.gov/nchs/nhanes/nhanes2003-2004/nhanes03_04.htm

    Information on: Demographics; Dietary; Examination; Laboratory

    For Demographics the list of available variables is:http://www.cdc.gov/nchs/nhanes/nhanes2003-2004/vardemo_c.htm

    The data comes in a format called xpt xpt is an export file from the SAS software, which is what the NHaNES

    people used.

    We need to install the package foreign

    install.packages(foreign) or use RStudio Packages tab

    Modeling Health, LLC 22

    Modeling Health LLC 23

    http://www.cdc.gov/nchs/nhanes/nhanes2003-2004/nhanes03_04.htmhttp://www.cdc.gov/nchs/nhanes/nhanes2003-2004/vardemo_c.htmhttp://www.cdc.gov/nchs/nhanes/nhanes2003-2004/vardemo_c.htmhttp://www.cdc.gov/nchs/nhanes/nhanes2003-2004/vardemo_c.htmhttp://www.cdc.gov/nchs/nhanes/nhanes2003-2004/vardemo_c.htmhttp://www.cdc.gov/nchs/nhanes/nhanes2003-2004/vardemo_c.htmhttp://www.cdc.gov/nchs/nhanes/nhanes2003-2004/nhanes03_04.htmhttp://www.cdc.gov/nchs/nhanes/nhanes2003-2004/nhanes03_04.htmhttp://www.cdc.gov/nchs/nhanes/nhanes2003-2004/nhanes03_04.htmhttp://www.cdc.gov/nchs/nhanes/nhanes2003-2004/nhanes03_04.htm
  • 8/9/2019 APrimerOn R Tutorial

    23/47

    Input II

    Save demo_c.xpt locally

    demo0304

    Modeling Health, LLC 23

    Modeling Health LLC 24

  • 8/9/2019 APrimerOn R Tutorial

    24/47

    Input III

    CSV From Local Directory

    read.csv(directoryLocation/fileName.csv,header=TRUE)

    From URL

    csvFile

  • 8/9/2019 APrimerOn R Tutorial

    25/47

    Output

    With the package foreign

    Let us use the file csvFile defined in the previous slide

    STATA write.dta(csvFile,dtaFile.dta) #writes a dta file in working directory

    SAS binary write.foreign(csvFile,sasFile.dat,sasFile.sas,package=SAS) # writes a .DAT sas file in the workingdirectory

    CSV write.csv(csvFile,"csvFile.csv") # writes a CSV file in the working

    directory

    Modeling Health, LLC 25

    Modeling Health LLC 26

  • 8/9/2019 APrimerOn R Tutorial

    26/47

    PART II

    Programming Tools

    Modeling Health, LLC 26

    Modeling Health LLC 27

  • 8/9/2019 APrimerOn R Tutorial

    27/47

    for () loops

    Syntax for (j in 1:N) {statements}

    EXAMPLE

    Vec5

  • 8/9/2019 APrimerOn R Tutorial

    28/47

    Conditionals: if{ } then{} else{}

    Read the csvFile from previous section

    csvFile

  • 8/9/2019 APrimerOn R Tutorial

    29/47

    Programming functions in R Syntax

    functionName

  • 8/9/2019 APrimerOn R Tutorial

    30/47

    Useful Tools for R programming

    fix(functionName) # allows to edit changes in the function Example: fix(raceDist)

    Debug(functionName) #walks the code of a function lineby line

    After invoking debug() the browser command appears Commands:

    n gives the next line in browser-mode.

    c continues the function until the end.

    Q quits the browser-mode.

    Example debug(raceDist)

    In the console try: raceDist(csvFile)

    IMPORTANT: after debugging have to run undebug(raceDist)

    Modeling Health, LLC 30

    Modeling Health, LLC 31

  • 8/9/2019 APrimerOn R Tutorial

    31/47

    PART III

    III.1 Data Analysis in RIII.2 Data Modeling in R

    g , 31

    Modeling Health, LLC 32

  • 8/9/2019 APrimerOn R Tutorial

    32/47

    Data analysis in R. 1

    This is an extensive field in data analysis.

    R is provided with a large number of functions to performanalysis: mean(), sd(), summary(),max(), min(), etc

    In practice, we will use the package rattle() written andmaintained by Dr. Graham Williams

    Install.packages(rattle) This steps is straightforward buy it involves multiple packages

    install.packages(rattle)

    Once rattle is installed invoke it in the console as: rattle()

    g ,

    Modeling Health, LLC 33

  • 8/9/2019 APrimerOn R Tutorial

    33/47

    Data Analysis in R. 2

    Load rattle(), andinvoke it in the console

    We will analyze the

    data from csvFile. The data gets loadedinto the session whenthe R image gets

    loaded: load(".RTutorialImage")

    See snapshot of rattlesIDE on the right panel:

    g ,

    Modeling Health, LLC 34

  • 8/9/2019 APrimerOn R Tutorial

    34/47

    Reading data into rattle

    Make sure the objectcsvFile is in yousession, i.e. type

    objects() in theconsole and check

    Select the R Datasetoption

    In the box DataName, locate csvFile

    Click Execute. Thefollowing opens:

    g

    Modeling Health, LLC 35

  • 8/9/2019 APrimerOn R Tutorial

    35/47

    Exploring data distributions

    Go to tab Explore inrattle

    As an example, I

    selected the age as avariable to explore.

    The boxplot,histogram, cumulative,

    and Benfordsplotsappear to the right.

    More variables couldbe used.

    Modeling Health, LLC 36

  • 8/9/2019 APrimerOn R Tutorial

    36/47

    Multiple regression model Variables: i4=average drinks per day Age=age of individual Substance=alcohol/cocaine/heroine Model: how does i4 depend on age and substance

    Estimate Std. Error t value Pr(>|t|) (Intercept) 18.2545 5.7713 3.163 0.00171 ** age 0.3341 0.1441 2.319 0.02106 * substancecocaine -17.5678 2.6301 -6.679 1.10e-10 *** substanceheroin -20.0985 2.7334 -7.353 1.71e-12 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

    Residual standard error: 19.18 on 313 degrees of freedom

    Multiple R-squared: 0.2183, Adjusted R-squared: 0.2108

    F-statistic: 29.14 on 3 and 313 DF, p-value: < 2.2e-16

    ==== ANOVA ====

    Analysis of Variance Table

    Response: i1 Df Sum Sq Mean Sq F value Pr(>F) age 1 7669 7669.4 20.847 7.159e-06 *** substance 2 24490 12245.2 33.285 7.825e-14 *** Residuals 313 115149 367.9

    Modeling Health, LLC 37

  • 8/9/2019 APrimerOn R Tutorial

    37/47

    Rattle give the option to build othermodels (beyond our scope)

    Trees

    Random Forests

    Neural Networks

    Modeling Health, LLC 38

  • 8/9/2019 APrimerOn R Tutorial

    38/47

    R has world support

    A plethora of developers with different specialties maintainand improve R

    Packages with multiple applications have to undergo acode per-review from the R project: http://www.r-

    project.org/index.html

    CRAN supports

    Modeling Health, LLC 39

    http://www.r-project.org/index.htmlhttp://www.r-project.org/index.htmlhttp://www.r-project.org/index.htmlhttp://www.r-project.org/index.htmlhttp://www.r-project.org/index.htmlhttp://www.r-project.org/index.html
  • 8/9/2019 APrimerOn R Tutorial

    39/47

    Applications of R in Biomedical Sciences

    There is no time to treat this topic with detail

    The reader is encourage to check it on her/his own: http://a-little-book-of-r-for-biomedical-

    statistics.readthedocs.org/en/latest/src/biomedicalstats.html#

    Modeling Health, LLC 40

    http://a-little-book-of-r-for-biomedical-statistics.readthedocs.org/en/latest/src/biomedicalstats.htmlhttp://a-little-book-of-r-for-biomedical-statistics.readthedocs.org/en/latest/src/biomedicalstats.htmlhttp://a-little-book-of-r-for-biomedical-statistics.readthedocs.org/en/latest/src/biomedicalstats.htmlhttp://a-little-book-of-r-for-biomedical-statistics.readthedocs.org/en/latest/src/biomedicalstats.htmlhttp://a-little-book-of-r-for-biomedical-statistics.readthedocs.org/en/latest/src/biomedicalstats.htmlhttp://a-little-book-of-r-for-biomedical-statistics.readthedocs.org/en/latest/src/biomedicalstats.htmlhttp://a-little-book-of-r-for-biomedical-statistics.readthedocs.org/en/latest/src/biomedicalstats.htmlhttp://a-little-book-of-r-for-biomedical-statistics.readthedocs.org/en/latest/src/biomedicalstats.htmlhttp://a-little-book-of-r-for-biomedical-statistics.readthedocs.org/en/latest/src/biomedicalstats.htmlhttp://a-little-book-of-r-for-biomedical-statistics.readthedocs.org/en/latest/src/biomedicalstats.htmlhttp://a-little-book-of-r-for-biomedical-statistics.readthedocs.org/en/latest/src/biomedicalstats.htmlhttp://a-little-book-of-r-for-biomedical-statistics.readthedocs.org/en/latest/src/biomedicalstats.htmlhttp://a-little-book-of-r-for-biomedical-statistics.readthedocs.org/en/latest/src/biomedicalstats.htmlhttp://a-little-book-of-r-for-biomedical-statistics.readthedocs.org/en/latest/src/biomedicalstats.htmlhttp://a-little-book-of-r-for-biomedical-statistics.readthedocs.org/en/latest/src/biomedicalstats.htmlhttp://a-little-book-of-r-for-biomedical-statistics.readthedocs.org/en/latest/src/biomedicalstats.htmlhttp://a-little-book-of-r-for-biomedical-statistics.readthedocs.org/en/latest/src/biomedicalstats.htmlhttp://a-little-book-of-r-for-biomedical-statistics.readthedocs.org/en/latest/src/biomedicalstats.htmlhttp://a-little-book-of-r-for-biomedical-statistics.readthedocs.org/en/latest/src/biomedicalstats.html
  • 8/9/2019 APrimerOn R Tutorial

    40/47

    PART IV

    Graphs in R

    Modeling Health, LLC 41

  • 8/9/2019 APrimerOn R Tutorial

    41/47

    X-Y plotting

    Use the csvFile data

    plot(csvFile$age,csvFile$pcs,xlab=Age(y),yl

    ab=MCS,main=Plot ofthe Mental CompositeScore Versus age inthe HELP study)

    Modeling Health, LLC 42

  • 8/9/2019 APrimerOn R Tutorial

    42/47

    3D plots

    library(rgl) #load rglpackage

    plot(csvFile$age,csvFil

    e$pcs,csvFile$cesd,xlab=Age(y),ylab=MCS,main=Plot of theMental Composite

    Score Versus age inthe HELP study)

    Modeling Health, LLC 43

  • 8/9/2019 APrimerOn R Tutorial

    43/47

    PART IV: ADVANCED TOPICS

    IN R (FOR THE FUTURE)

    Object Oriented Programming in RParallel Programming

    R Programming in the Cloud

    Numerical Simulations in R

    Modeling Health, LLC 44

  • 8/9/2019 APrimerOn R Tutorial

    44/47

    A personal suggestion/opinion Start easy and build up in complexity

    Learn R with Lams book then move to more advanced works, i.e. useChambers book when you are VERY comfortable with R

    Pick up any interesting problem you want to solve, then goahead and do it in R. Examples:

    Financial time series Stochastic Processes Pharmacoeconomics Physiological modeling, Etc

    Get familiar with the relevant R packages at CRAN: http://cran.r-

    project.org/web/packages/available_packages_by_name.html Subcribe to R-bloggers: http://www.r-bloggers.com/ Form an R meetup users group Dont study R, use it and have fun with it.

    45

    http://cran.r-project.org/web/packages/available_packages_by_name.htmlhttp://cran.r-project.org/web/packages/available_packages_by_name.htmlhttp://www.r-bloggers.com/http://www.r-bloggers.com/http://www.r-bloggers.com/http://www.r-bloggers.com/http://www.r-bloggers.com/http://cran.r-project.org/web/packages/available_packages_by_name.htmlhttp://cran.r-project.org/web/packages/available_packages_by_name.htmlhttp://cran.r-project.org/web/packages/available_packages_by_name.htmlhttp://cran.r-project.org/web/packages/available_packages_by_name.html
  • 8/9/2019 APrimerOn R Tutorial

    45/47

    Bibliography 1

    Braun WJ and Murdoch DJ, A first course in statistical programming with R (Cambridge UP, CambridgeUK, 2007)

    Excellent book for beginers.

    Chambers JM (2008) Software for Data Analysis: http://www.e-reading.org.ua/bookreader.php/137398/Software_for_Data_Analysis_-_Programming_with_R.pdf

    This is an advanced book!!!

    Coghlan Avril (2012) A Little Book of R for Biomedical Statistics: https://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdf

    Journal of Statistical Software, http://www.jstatsoft.org/ Excellent source of papers on diverse statistical applications. Many of the papers are R packages.

    Kainman K and Horton NJ, SAS and R (CRC Press, New York NY, 2010) Great book with lots of examples. Excellent if you come to R from SAS.

    Lam, L (2010) An introduction to R: http://cran.r-project.org/doc/contrib/Lam-IntroductionToR_LHL.pdf This is the best intro book on R I know.

    Maindonald J and Braun WJ, Data Analysis and Graphics Using R (Cambridge UP, Cambridge UK, 2010) Third Edition. An excellent reference. Not for the beginner, it assumes a lot of background in R. Also the notation is very compact.

    Modeling Health, LLC

    Modeling Health, LLC 46

    http://www.e-reading.org.ua/bookreader.php/137398/Software_for_Data_Analysis_-_Programming_with_R.pdfhttp://www.e-reading.org.ua/bookreader.php/137398/Software_for_Data_Analysis_-_Programming_with_R.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttp://www.jstatsoft.org/http://cran.r-project.org/doc/contrib/Lam-IntroductionToR_LHL.pdfhttp://cran.r-project.org/doc/contrib/Lam-IntroductionToR_LHL.pdfhttp://cran.r-project.org/doc/contrib/Lam-IntroductionToR_LHL.pdfhttp://cran.r-project.org/doc/contrib/Lam-IntroductionToR_LHL.pdfhttp://cran.r-project.org/doc/contrib/Lam-IntroductionToR_LHL.pdfhttp://cran.r-project.org/doc/contrib/Lam-IntroductionToR_LHL.pdfhttp://cran.r-project.org/doc/contrib/Lam-IntroductionToR_LHL.pdfhttp://www.jstatsoft.org/http://www.jstatsoft.org/https://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttps://media.readthedocs.org/pdf/a-little-book-of-r-for-biomedical-statistics/latest/a-little-book-of-r-for-biomedical-statistics.pdfhttp://www.e-reading.org.ua/bookreader.php/137398/Software_for_Data_Analysis_-_Programming_with_R.pdfhttp://www.e-reading.org.ua/bookreader.php/137398/Software_for_Data_Analysis_-_Programming_with_R.pdfhttp://www.e-reading.org.ua/bookreader.php/137398/Software_for_Data_Analysis_-_Programming_with_R.pdfhttp://www.e-reading.org.ua/bookreader.php/137398/Software_for_Data_Analysis_-_Programming_with_R.pdfhttp://www.e-reading.org.ua/bookreader.php/137398/Software_for_Data_Analysis_-_Programming_with_R.pdfhttp://www.e-reading.org.ua/bookreader.php/137398/Software_for_Data_Analysis_-_Programming_with_R.pdf
  • 8/9/2019 APrimerOn R Tutorial

    46/47

    Bibliography 2

    Matloff N,The Art of R Programming (No starch press, San Francisco, 2011)

    One of my favorites references covering both elementary and up to dateapplications in R.

    The R Journal, http://journal.r-project.org/

    Papers available from repository since 2001.

    Spector P, Data Manipulation with R (Springer, 2008)

    Nice little book with good practical examples on special topics.

    Torgo L, Data Mining with R (CRC Press, Boca Raton, FL, 2011)

    Good selected topics on data mining with R.

    Modeling Health, LLC 47

    http://journal.r-project.org/http://journal.r-project.org/http://journal.r-project.org/http://journal.r-project.org/http://journal.r-project.org/
  • 8/9/2019 APrimerOn R Tutorial

    47/47

    Bibliography 3

    Venables, WN, and Smith DM (2012) An introuduction to R:http://cran.r-project.org/doc/manuals/R-intro.pdf

    The classic reference, to learn R I prefer Lams work. But use what

    fits you best.

    Williams, G, Data Mining with Rattle and R (Springer, 2011)

    Excellent book on data mining. Also the rattle IDE is very good.

    Witten IH, Frank E, and Hall M, Data Mining practical machinelearning tools and techniques (MK, Amsterdan, 2011) 3rdEd.

    http://cran.r-project.org/doc/manuals/R-intro.pdfhttp://cran.r-project.org/doc/manuals/R-intro.pdfhttp://cran.r-project.org/doc/manuals/R-intro.pdfhttp://cran.r-project.org/doc/manuals/R-intro.pdfhttp://cran.r-project.org/doc/manuals/R-intro.pdfhttp://cran.r-project.org/doc/manuals/R-intro.pdf