89
Introduc)on to BIST Biosta+s+cs course May 6 th , 2016 Sarah Bonnin CRG Bioinforma)cs Core Facility 06/05/16 1

160506 Introduction to R - Biocore CRG

  • Upload
    others

  • View
    8

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 160506 Introduction to R - Biocore CRG

Introduc)onto

BISTBiosta+s+cscourseMay6th,2016SarahBonnin

CRGBioinforma)csCoreFacility

06/05/16 1

Page 2: 160506 Introduction to R - Biocore CRG

Outline

•  R:what,when,why?•  GeEngstarted•  Datastructures•  Libraries/Packages•  Basiccommands•  Func)ons•  RStudio

06/05/16 2

Page 3: 160506 Introduction to R - Biocore CRG

R:what,when,why?

06/05/16 3

Page 4: 160506 Introduction to R - Biocore CRG

WhatisR?

•  IntegratedsuiteofsoNwarefacili)esfordatamanipula+on,calcula+onandgraphicaldisplay.

•  Simpleandeffec)veprogramminglanguagewhichincludescondi)onals,loopsetc.

•  Implementa)onoftheSprogramminglanguage(Belllaboratories)

R:what,when,why?

06/05/16 4

Page 5: 160506 Introduction to R - Biocore CRG

WhatisR?

•  CreatedbyRossIhakaandRobertGentlemanattheUniversityofAuckland,NewZealand

•  Nowdevelopedbythe“Rdevelopmentcoreteam”

•  GNUproject(freesoNware,passcollabora)on)

àOpensource!

R:what,when,why?

06/05/16 5

Page 6: 160506 Introduction to R - Biocore CRG

h]ps://www.r-project.org/

R:what,when,why?

06/05/16 6

Page 7: 160506 Introduction to R - Biocore CRG

WhentouseR?

•  Dataanalysis•  Sta)s)calmodeling•  Simula)on•  Graphics

R:what,when,why?

06/05/16 7

Page 8: 160506 Introduction to R - Biocore CRG

WhytouseR?

•  Flexible•  Powerful•  Interac)ve•  Veryac+vecommunityofdevelopersandusers!

R:what,when,why?

06/05/16 8

Page 9: 160506 Introduction to R - Biocore CRG

R:what,when,why?

06/05/16 9

Page 10: 160506 Introduction to R - Biocore CRG

GeDngstarted

06/05/16 10

Page 11: 160506 Introduction to R - Biocore CRG

Rsyntax

func+on(arguments)example:

list.files(path=".")

command argument

Ge.ngstarted

06/05/16 11

Page 12: 160506 Introduction to R - Biocore CRG

Rsyntax

a<-func+on(arguments)example:

myobject<-list.files(path=".")

object assignmentoperator

Ge.ngstarted

06/05/16 12

Page 13: 160506 Introduction to R - Biocore CRG

Rsyntax

•  Casesensi)ve:List.fileslist.files

•  Commentlinesstartwith#

•  Commandsseparatedby;oranewline

•  Argumentsinafunc)onseparatedby,

Ge.ngstarted

06/05/16 13

Page 14: 160506 Introduction to R - Biocore CRG

GeEnghelp

•  help(func+on)•  ?func+on

•  Google!

Ge.ngstarted

06/05/16 14

Page 15: 160506 Introduction to R - Biocore CRG

Star)ngRinterac)velyfromaterminal

•  Star)ngsession:R•  Endingsession:q()

Ge.ngstarted

06/05/16 15

Page 16: 160506 Introduction to R - Biocore CRG

DataStructures

Vectors

Factors

Matrices

Dataframes

List

06/05/16 16

Page 17: 160506 Introduction to R - Biocore CRG

DataTypes•  Everyvaluehasadatatypethattellswhatsortofvalueitis.

•  Mostcommondatatypes:

–  Numeric(Numbers)–  Character(Text)–  Logical(True/False)

•  Checkingobjecttypewithmode():–  mode("a")/[1]"character”–  mode(10)/[1]"numeric”–  mode(FALSE)/[1]"logical"

Datastructures

06/05/16 17

Page 18: 160506 Introduction to R - Biocore CRG

Vectors

•  Sequenceofdataelementsofthesametype•  Elementsofanatomicvectorareofonetypeonly,either:– Numeric(1,2,5.3,6,-2,4)– Character("one","two","three")– Logical(TRUE,TRUE,TRUE,FALSE,TRUE,FALSE)

Datastructures

06/05/16 18

Page 19: 160506 Introduction to R - Biocore CRG

Vectors

•  Assignmentofvaluestovectorusingtheccommand(combiningelements)

myvector<-c(0.5,2,10,3,8)myvector<-1:5•  Checkingifanobjectisavectorwithis.vector(myvector)

Datastructures

06/05/16 19

sameasc(1,2,3,4,5)

Page 20: 160506 Introduction to R - Biocore CRG

Vectors

•  Fetchelementsofavector:subscripts

a

a[1]a[2:4]a[c(5,7)]

1 9 4 8 0 11 7

Datastructures

06/05/16 20

Page 21: 160506 Introduction to R - Biocore CRG

Factors

•  Vectorobjectusedtospecifyadiscreteclassifica+onofthecomponentsinadataset:

àCategoricalvariables

•  Usedmainlyinsta+s+calmodeling,butalsoinsomegraphicalfunc)ons.

•  Similartovectors,buttheirvaluesarelimitedtoafixedsetofpossiblevalues.

Datastructures

06/05/16 21

Page 22: 160506 Introduction to R - Biocore CRG

Factors

•  Bothnumericandcharactervariablescanbemadeintofactors.

myfactor<-factor(c("a","a","b","c",1,2))

myfactor[1]aabc12Levels:12abc

Datastructures

Levelsarecharactervectors

06/05/16 22

Page 23: 160506 Introduction to R - Biocore CRG

Factors

•  Checkingifanobjectisafactor:–  is.factor(myfactor)

•  Transformingavectorintoafactor:– as.factor(myvector)

Datastructures

06/05/16 23

Page 24: 160506 Introduction to R - Biocore CRG

Matrices

•  Amatrixisavectorof2dimensions•  Allcolumnsinamatrixmusthave:–  thesametype(numeric,character,logical)–  thesamelength

a<-matrix(c(1,0,34,5,13,44,12,4,3,8,6,9,22,7,76),

nrow=5, ncol=3)

Datastructures

06/05/16 24

Page 25: 160506 Introduction to R - Biocore CRG

Matrices

•  Fetchrows,columnsorsingleelementsofamatrixusingsubscript:

a[,]

Datastructures

rowindices

columnindices

06/05/16 25

Page 26: 160506 Introduction to R - Biocore CRG

Matrices

•  Fetchrows,columnsorsingleelementsofamatrixusingsubscript:

a1 44 6

0 12 9

34 4 22

5 3 7

13 8 76

a[1,]

a[2:3,]

a[,3]

a[5,1]

Datastructures

06/05/16 26

Page 27: 160506 Introduction to R - Biocore CRG

Dataframes

•  Structuresof2dimensions.

•  Moregeneralthanmatrices.•  Differentcolumnscanhavedifferenttypesbutmusthavethesamelength.

a<-data.frame(c(1,3,34,5,13),

c(“etc”,“ok”,“yes”,“no”,“well”), c(TRUE,TRUE,FALSE,FALSE,TRUE))

Datastructures

06/05/16 27

Page 28: 160506 Introduction to R - Biocore CRG

1 etc TRUE

3 ok TRUE

34 yes FALSE

5 not FALSE

13 well TRUE

Dataframes

•  Fetchrows,columnsorsingleelementsofadataframeusingsubscript:

a

a[1,]

a[2:3,]

a[,3]

a[5,1]

Datastructures

06/05/16 28

Page 29: 160506 Introduction to R - Biocore CRG

Matricesanddataframesdimensionnames

a<-matrix(c(1,0,34,5,13,44), nrow=3, ncol=2, dimnames=list(c(”row1”,”row2”,”row3”),c(”col1”,”col2”)))

b<-data.frame(c(1,0,34),

c(5,13), row.names=c("row1","row2","row3"), col.names=,c(”col1”,”col2”))

Datastructures

06/05/16 29

Page 30: 160506 Introduction to R - Biocore CRG

Matricesanddataframesdimensionnames

•  Changingcolumnand/orrownames:colnames(x)<-c(“a”,“b”,“c”)rownames(x)<-1:5

•  Changingcolumnandrownamesatonce:dimnames(x)<-list(c(“a”,“b”,“c”),1:5)

Datastructures

06/05/16 30

Page 31: 160506 Introduction to R - Biocore CRG

Matricesanddataframesdimensionnames

col1 col2

row1 1 5

row2 0 13

row3 34 44

Matrix Dataframe

a[,"col1”]

a["col1”]

a$col1

a["row1",]

a["row1”]

a["row1","col1"]

b[,"col1”]

b["col1”]

b$col1

b["row1",]

b["row1”]

b["row1","col1"]

Datastructures

06/05/16 31

Page 32: 160506 Introduction to R - Biocore CRG

MatricesanddataframesChecksandconversions

Datastructures

06/05/16 32

•  Checkingiftheobjectisamatrix…is.matrix(mymatrix)

…oradataframe:is.data.frame(mydataframe)

•  Conver)ngamatrixintoadataframe…as.matrix(mydataframe)

…orviceversa:as.data.frame(mymatrix)

Page 33: 160506 Introduction to R - Biocore CRG

Lists

•  Linearstructures.•  Acomponentofalistcanbeanydatastructure

(matrix,vector,dataframe,anotherlist)

Datastructures

06/05/16 33

Page 34: 160506 Introduction to R - Biocore CRG

Lists

•  Createalist:x<-list()x<-list(c(“fir”,“sec”,“th”),

c(0,20,4,2), TRUE, matrix(c(2,5,4,6,3,7), nrow=2,ncol=3))

Datastructures

#1stelementofthelist

#2delementofthelist

#3delementofthelist

#4thelementofthelist

06/05/16 34

#Emptylistthatcanbefilledlateron

Page 35: 160506 Introduction to R - Biocore CRG

Lists

•  Accessingelementsofalistx:

x[[1]]x[[2]][3]

x[[4]][1,2]

“fir”,“sec”,”th” 0,20,4,2 TRUE2 4 3

5 6 7

Datastructures

06/05/16 35

Page 36: 160506 Introduction to R - Biocore CRG

Namingelementsofalist

x<-list(charvector=c(“fir”,“sec”,“th”), numvector=c(0,20,4,2), oneboolean=TRUE, onematrix=matrix(c(2,5,4,6,3,7), nrow=2,ncol=3))

ornames(x)<-c(“charvector”,“numvector”,“oneboolean”,“onematrix”)

Datastructures

06/05/16 36

Page 37: 160506 Introduction to R - Biocore CRG

Accessingelementsoflistxpername

x[“charvector”]or

x$charvector

x[“numvector”][3]or

x$numvector[3] x[“onematrix”][1,2]or

x$onematrix[1,2]

“fir”,“sec”,”th” 0,20,4,2 TRUE2 4 3

5 6 7

charvector numvector oneboolean onematrix

Datastructures

06/05/16 37

Page 38: 160506 Introduction to R - Biocore CRG

Lengthanddimensionoflists

•  Listshavealengthbutonlyonedimension

•  Elementswithinalistcanhavelengthsanddimensions,dependingontheirdatastructure.

Datastructures

“fir”,“sec”,”th” 0,20,4,2 TRUE2 4 3

5 6 7

length(x)

4

length(x[[2]])

4dim(x[[4]])

2306/05/16 38

Page 39: 160506 Introduction to R - Biocore CRG

Checkingandconver)ngdatatypesandstructures

Datastructures

Checking Conver+ngis.matrix(x) as.matrix()

is.data.frame(x) as.data.frame()

is.vector() as.vector()

is.list() as.list()

is.factor() as.factor()

is.character() as.character()

is.numeric() as.numeric()

06/05/16 39

Page 40: 160506 Introduction to R - Biocore CRG

Library/packages

06/05/16 40

Page 41: 160506 Introduction to R - Biocore CRG

Library/packages

•  Packagesarecollec)onsofRfunc)ons,data,andcompiledcodeinawell-definedformat.

•  Thedirectorywherepackagesarestorediscalledthelibrary.

Library/packages

Defini&onsfromh.p://www.statmethods.net/interface/packages.html06/05/16 41

Page 42: 160506 Introduction to R - Biocore CRG

Standardpackages

•  About25standardpackagesaresuppliedwithRbydefault(example:base,stats,graphics).

•  OnMay4th2016,8340packageswereavailable!•  AnyonecancontributetotheRpackagerepository

Library/packages

06/05/16 42

Page 43: 160506 Introduction to R - Biocore CRG

Installingandloadingpackages

•  Packagescanbeinstalledfrom:

–  theinterac)vesession:install.packages(“ggplot2”)install.packages(“ggplot2”,repos=

h]p://cran.r-project.org/web/packages/)

–  theterminal:RCMDINSTALLggplot2_version.tar.gz

•  Andloaded:library(“ggplot2”)

Library/packages

06/05/16 43

Page 44: 160506 Introduction to R - Biocore CRG

Lis)ngpackages

•  Installedpackages:library()acepackace()andavas()forselec)ngregressiontransforma)onsaffyMethodsforAffymetrixOligonucleo)deArraysaffyioToolsforparsingAffymetrixdatafilesAnnota)onDbiAnnota)onDatabaseInterfaceBiobaseBiobase:Basefunc)onsforBioconductorBiocGenericsS4genericfunc)onsforBioconductor…•  Loadedpackages:search()[1]".GlobalEnv""package:stats""package:graphics"[4]"package:grDevices""package:u)ls""package:datasets"[7]"package:methods""Autoloads""package:base"

Library/packages

06/05/16 44

Page 45: 160506 Introduction to R - Biocore CRG

Lis)ngfunc)onsfrompackages

•  ls(“package:yourpackage”)•  ls(“package:VennDiagram”)[1]"add.)tle""adjust.venn"[3]"calculate.overlap""decide.special.case"[5]"draw.pairwise.venn""draw.quad.venn"[7]"draw.quintuple.venn""draw.single.venn"…."

Library/packages

06/05/16 45

Page 46: 160506 Introduction to R - Biocore CRG

Accessingpackage’sfunc)ons

•  Usually,callingthefunc)onbyitsnameisenough:add.+tle()

•  If2packageshaveafunc)onwiththesamename,makesureyouareusingtherightone:VennDiagram::add.+tle()

Library/packages

06/05/16 46

Page 47: 160506 Introduction to R - Biocore CRG

Basiccommands

06/05/16 47

Page 48: 160506 Introduction to R - Biocore CRG

GeEngandchangingworkingdirectory

•  getwd()– Returnscurrentworkingdirectory

•  setwd(“/home/mydir/”)– Changescurrentworkingdirectoryto“/home/mydir”

Basiccommands

06/05/16 48

Page 49: 160506 Introduction to R - Biocore CRG

Informa)onaboutobjects•  summary(x)

àfornumericaldata:min,max,medianetc.àforcharacterdata:countofitemsoccurrences

Basiccommands

06/05/16 49

col1 col2 col3

1 ok TRUE

3 yes FALSE

5 no FALSE

6 maybe FALSE

col1col2col3Min.:1.00maybe:1Mode:logical1stQu.:2.50no:1FALSE:3Median:4.00ok:1TRUE:1Mean:3.75yes:1NA's:03rdQu.:5.25Max.:6.00

Page 50: 160506 Introduction to R - Biocore CRG

Informa)onaboutobjects

•  str(x):àInternalstructureofanRobject

'data.frame':4obs.of3variables:$col1:num1356$col2:Factorw/4levels"maybe","no","ok",..:3421$col3:logiTRUEFALSEFALSEFALSE

Basiccommands

06/05/16 50

col1 col2 col3

1 ok TRUE

3 yes FALSE

5 no FALSE

6 maybe FALSE

Page 51: 160506 Introduction to R - Biocore CRG

Size/dimensionsofobjectsBasiccommands

numberofelementsinvector,factororlist length(x)

dimensionsofmatrixordataframe dim(x)

numberofrowsofmatrixordataframe nrow(x)

numberofcolumnsofmatrixordataframe ncol(x)

06/05/16 51

Page 52: 160506 Introduction to R - Biocore CRG

Elementaryarithme)coperatorsBasiccommands

addi)on +

subtrac)on -

division /

mul)plica)on *

exponen)a)on ^or**

06/05/16 52

Page 53: 160506 Introduction to R - Biocore CRG

LogicaloperatorsBasiccommands

inferior <inferiororequal <=

superior >superiororequal >=

equality ==inequality !=

intersec)on(“and”) &union(“or”) |

06/05/16 53

Page 54: 160506 Introduction to R - Biocore CRG

Obtainingsummarysta)s)csBasiccommands

average/mean mean(x)

median median(x)

minimum min(x)

maximum max(x)

variance var(x)

correla)on cor(x)

06/05/16 54

Page 55: 160506 Introduction to R - Biocore CRG

Somecommonarithme)cfunc)onsBasiccommands

naturallogarithm log(x)exponen)alfunc)on

e^x exp(x)

sine sin(x)

cosine cos(x)

tangent tan(x)

absolutevalue abs(x)

squareroot sqrt(x)

06/05/16 55

Page 56: 160506 Introduction to R - Biocore CRG

Objectsstoredintheglobalenvironment

•  Lis)ng:ls()orobjects()•  Removingoneobjectfromenvironment:rm(x)•  Removingseveralobjects:rm(x,y)

•  Removingallobjectfromenvironment:rm(list=ls())

Basiccommands

06/05/16 56

Page 57: 160506 Introduction to R - Biocore CRG

Readingandwri)ngfilesBasiccommands

Readingfileintoobject

a<-read.table(“file.txt”)

Wri)ngobjecttofile

write.table(a,“file.txt”)

06/05/16 57

Page 58: 160506 Introduction to R - Biocore CRG

Savingobjectsorsession

•  Saveobjectsxandyinto“myobjects.RData”file– save(x,y,file=“myobjects.RData”)

•  Loadobjectsxandyintocurrentdirectory:–  load(“myobjects.RData”)

•  Savethecurrentworkspace(allobjects):– save.image(file=“.RData”)

Basiccommands

06/05/16 58

Page 59: 160506 Introduction to R - Biocore CRG

Commandhistory

•  Last25commands:–  history()

•  Allpreviouscommands–  history(max.show=Inf)

•  Savecommandhistory:–  savehistory()

•  Loadcommandhistory:–  loadhistory()

Basiccommands

06/05/16 59

Page 60: 160506 Introduction to R - Biocore CRG

Informa)onaboutthecurrentsession

sessionInfo()

Basiccommands

Rversion

PlavormandOSversion

Packagesawached

06/05/16 60

Page 61: 160506 Introduction to R - Biocore CRG

Func+onsinR

06/05/16 61

Page 62: 160506 Introduction to R - Biocore CRG

Knowingthesourcecodeofafunc)on

•  Nameofthefunc)onwithout()Forexample:

sort

func)on(x,decreasing=FALSE,...){if(!is.logical(decreasing)||length(decreasing)!=1L)stop("'decreasing'mustbealength-1logicalvector.\nDidyouintendtoset'par)al'?")UseMethod("sort")}

Func@ons

06/05/16 62

Page 63: 160506 Introduction to R - Biocore CRG

User-wri]enfunc)ons

•  Func)onsarepiecesofcodewri]entocarryout(a)specifiedtask(s)andbeabletorepeatit(them)easily.

•  Rallowsyoutocreateyourownfunc)ons.

Func@ons

06/05/16 63

Page 64: 160506 Introduction to R - Biocore CRG

Func)ons’structure

myfunc+on<-func+on(arg1,arg2,...){ commands return(something)}

Func@ons

Func+on’sname Crea+ngthefunc+on

myfunc+on’slistofarguments

whatmyfunc+ondoes

Value/objectmyfunc+onreturns

06/05/16 64

Page 65: 160506 Introduction to R - Biocore CRG

Func@ons

Objectsinafunc+onarelocaltothatfunc+on!

fromhBps://www.datacamp.com/community/tutorials/func@ons-in-r-a-tutorial06/05/16 65

Page 66: 160506 Introduction to R - Biocore CRG

Objectsinfunc)onsmyfunc+on<-func+on(arg1){a<-arg1return(a+1)

}

Func@ons

06/05/16 66

>a<-12>myfunc)on(10)[1]11>a[1]12

>myfunc)on(10)[1]11>aError:object'a'notfound

Page 67: 160506 Introduction to R - Biocore CRG

Exampleofafunc)on

Func+on“somestats”:

takesasanargument:onenumericvector.computes:medianandmeanofthatvector.returns:avectorcontainingthese2values.

Func@ons

06/05/16 67

Page 68: 160506 Introduction to R - Biocore CRG

Exampleofafunc)onsomestats<-func)on(vector_input){ my_mean<-mean(vector_input) my_median<-median(vector_input)

return(c(my_mean,my_median))}

x<-c(0,2,1,6.3,2.2,10,8,5.4)

somestats(x)4.36253.8000

Func@ons

06/05/16 68

Page 69: 160506 Introduction to R - Biocore CRG

Savingandsourcingfunc)onsFunc@ons

06/05/16 69

somestats<-func)on(vector_input){ my_mean<-mean(vector_input) my_median<-median(vector_input) vector_output<-c(my_mean,my_median) return(c(vector_output))}

source(“myfunc+ons.R”)àContentofmyfunc+ons.Rloadedintheuserworkspace(globalenvironment)

myfunc+ons.R

Page 70: 160506 Introduction to R - Biocore CRG

RStudio

06/05/16 70

Page 71: 160506 Introduction to R - Biocore CRG

WhatisRstudio?•  FreeandopensourceIDE(IntegratedDevelopmentEnvironment)forR

•  AvailableforWindows,MacOSandLinux•  Wri]eninC++•  Firstbetaversionavailablein2009

•  Userfriendlyenvironment

RStudio

06/05/16 71

Page 72: 160506 Introduction to R - Biocore CRG

Screen:4windowsRStudio

3.Environmentandhistory

1.Console 4.Files,plots,packages,help

2.Rscript

06/05/16 72

Page 73: 160506 Introduction to R - Biocore CRG

RStudio

1.Console

Console:Interac+veenvironment.àWheretheworkisdone.Averyintui+veterminal!

06/05/16 73

Page 74: 160506 Introduction to R - Biocore CRG

RStudio

2.Rscript

Savedscript

Canberunen+rely

Canberunbyline/block

06/05/16 74

Page 75: 160506 Introduction to R - Biocore CRG

RStudio

3.Environmentandhistory

Globalenvironment:allobjectspresentinthesession

Youcanalso:SavethecurrentworkspaceLoadasavedworkspaceImportdatasets

Listfunc+onsavailableperpackage

06/05/16 75

Page 76: 160506 Introduction to R - Biocore CRG

RStudio

3.Environmentandhistory

History:Commandsusedduringthesession.Canberunagain,copiedintofile,etc.

06/05/16 76

Page 77: 160506 Introduction to R - Biocore CRG

RStudio

4.Plotarea

DisplaysthegraphsYoucan:•  Gobacktothepreviousplot•  Zoom•  Exportintopdf,jpeg,png,+ff,etc.

06/05/16 77

Page 78: 160506 Introduction to R - Biocore CRG

RStudio

4.Files

Directoriesandfilesincurrentworkingdirectory

06/05/16 78

Page 79: 160506 Introduction to R - Biocore CRG

RStudio

4.Packages

Listofpackages:•  Available•  Loadedincurrentsession(+cked)

Youcan:•  Installnewpackages•  Updatepackagestonewestversions

06/05/16 79

Page 80: 160506 Introduction to R - Biocore CRG

RStudio

4.Help

Helptab:•  RandRStudiodocumenta+on•  Packagesandfunc+onshelppage

displayedherewhenrequested

06/05/16 80

Page 81: 160506 Introduction to R - Biocore CRG

RMD:RMarkdown

•  Formatforwri)ngreproducible,dynamicreportswithR.

•  Workdirectlyinsertedintoforma]eddocuments(HTML,PDFandWord)

•  Easytouse!

RStudio

06/05/16 81

Page 82: 160506 Introduction to R - Biocore CRG

RStudio

RMD:RMarkdown

06/05/16 82

Page 83: 160506 Introduction to R - Biocore CRG

RStudio

RMD:RMarkdown

.Rmdextensionfiles

06/05/16 83

Page 84: 160506 Introduction to R - Biocore CRG

RStudio

RMD:RMarkdown

06/05/16 84

Page 85: 160506 Introduction to R - Biocore CRG

RStudio

RMD:RMarkdown

```{r}YOURCODE```

06/05/16 85

Page 86: 160506 Introduction to R - Biocore CRG

RStudio

RMD:RMarkdown

echo=TRUEeval=TRUEcode+outputinreportecho=FALSEeval=TRUEonlyoutputinreport

06/05/16 86

Page 87: 160506 Introduction to R - Biocore CRG

RStudio

RMD:RMarkdown

knitrpackagedynamicreportgenera)oninR

06/05/16 87

Page 88: 160506 Introduction to R - Biocore CRG

RStudio

RMD:RMarkdown

KnittoHTMLàCreatesa.htmlfile

06/05/16 88

Page 89: 160506 Introduction to R - Biocore CRG

Usefulresources

•  QuickR:h]p://www.statmethods.net/•  Rbloggers:h]p://www.r-bloggers.com/•  CookbookforR:h]p://www.cookbook-r.com/•  Rforgeforum:h]ps://r-forge.r-project.org/forum/forum.php?forum_id=78

•  Rhelp:h]p://r.789695.n4.nabble.com/R-help-f789696.html

06/05/16 89