Date post: | 13-Feb-2017 |
Category: |
Data & Analytics |
Upload: | xavier-prudent |
View: | 89 times |
Download: | 2 times |
ImproveyourPerformancewithRNotebookRShiny
XavierPrudentDataScien<st–Consultantindataminingandmachinelearning
www.xavierprudent.com
MaxPlanckIns<tuteCellBiologyandGene<cs
23thJanuary2017
RStudioh#ps://www.rstudio.com/products/rstudio/download/RshinyInstall.packages(“shiny”)
AllyouneedisR
WALL OF SHAME – PART 1
Analyzing&tes<ngallalongtheyear(s)
• manyback&forth• documentasmuchasyoucan
ü flexibilitywhathappensifyousettheparameterto‘2’
ü paranoid
doyouhavethisplotyoushowedme3monthsago?ü reproducibility
Iwantthisplotbutchangetheblueforgreen
ReproducibilityinScienceiskey
knitr
RNotebookinapraline
R Notebook
RNotebook:appearancemaTers
Rcode
Variables,history
StandardRconsole
PlotsPackages
RStudio:auser-friendlyReditor
#1Crea<nganRnotebookdocument
Tocreatethereport
Detailsofthedocument(yourproject)
SyntaxtoincludeRcode
Comment
Pageorganiza<on(<tles)
BasiccodeforabasicreportinRNotebook
Comment
Detailsofthedocument(yourproject)
Rcode
Rprintout
Aswellasplots,warnings,errors…
BasicRNotebookisalreadywhatyouneed
#2PimpingupRnotebookdocument
Commen<ngout
Paragraphs
Maths
Lists
Tables
#3RunningR
AllstandardRcodes/analysiscanbeincluded!Automa<cresultintext
FullRanalysis(canbesourcedfromanexternalcode)
#4Preparingareport
Codewon’tberun
Coderunbutnotdisplayed
Coderun,errors&warningsnotdisplayed
Figuresize
Andmore:-makeyourdocumentinterac<vewithRshiny…-publishitonRstudio(well…)
Bigdatafile?Convertittoan.Rdatoopenitfaster
WALL OF SHAME – PART 2
forwardGenomics.R --analysis = 'local’ --list = elements.txt --tree = tree.mod --outFile = outFile --outPath = /user/dir/out/ --verb = TRUE --lossNodes = lossNode.txt --indepLoss = 1 --globalPid = globalPercent.txt --transf = 'raw' or 'ranked’ --localPid = localPercent.txt --weights = weights.txt --meanPid = meanPercentID.txt --neutProb = neutralProb.txt --collapseClades = ‘
Newcomers?Students?Inves<ga<on?
AUserFriendlySoeware
Javascript, css
R Shiny
RShinyinapraline
WebHTML
RShiny:crunchyandnicelooking
UserInterface
Serverinput
output
RShinyworkslikeastandardwebpage
#1Crea<ngaRShinydocument
Impor<ngthepackage
Pagelayout(rows,columns)
Userinput(slider)
Displayplot
Createplot
Runtheapp
#2RunningtheRShinyApp
Runtheapp
Sharetheapp>runApp("app.R")
AnyRinput/output/analysisispossible
#3PimpinguptheRShinyApp
Let’saddsomeCOLOR
Userinterface
Server
Manydifferenttypesofinputpossible
Reac<vityShouldthegiveninputbetakenimmediatelyintoaccount?
observeEvent()ReacAve()àvalues,useracAon,delay…
Goodlooking• HTMLstaFctags:header,bold,italic• CSSfilecanbeincluded• Javascriptcodecanbeincluded• Imagecanbeincluded(wwwdirectory)
Deploying
• Intern:setupaRShinyserver• Freeath#p://shinyapps.io
#4GoingfurtherwithRShiny
RnotebookRshiny
addcollabora<veassettothepowerofR
spreadingVERYfastthroughresearch,finance,insurance…
OpensourceAnalysis-friendlyUser-friendlyCareer-friendly
RNotebookhTp://rmarkdown.rstudio.com/r_notebooks.htmlh#ps://www.rstudio.com/wp-content/uploads/2015/02/rmarkdown-cheatsheet.pdfh#ps://yihui.name/knitr/
RShinyh#p://shiny.rstudio.com/tutorial/h#p://shiny.rstudio.com/images/shiny-cheatsheet.pdfh#ps://shiny.rstudio.com/gallery/
Ques<[email protected]
Dowanttoknowmore?