没看完
![]() | Title: Reproducible Research with R and RStudio 2nd ed Authors: Christopher Gandrud Edition: 2 Finished Date: 2014-03-19 Rating: 5 Language: English Genres: Programming, R, Software, RStudio Level: Entry Publishers: Chapman and Hall/CRC Publication Date: 2015-06-13 ISBN: 978-1498715379 Format: Pdf Pages: 324 Download: Pdf |
Ch 13
presenting on web with Markdown
Markdown
make it easy to write HTML or XHTML using a syntax
that is human readable and
possibly publishable without compilingdoes not have as many capabilities as HTML
- Rmarkdown
- lack
- live updating
- word counts
- save in PDF formats
- multiple CSS
- lack
- mac
- http://mouapp.com/
- http://markedapp.com/
- integrated well with RSTudio as it only previews markdown documents
- more functionality than RStudio’s Preview HTML window
- windows
- example codes
mathjax
- javascript
- same syntax with LaTex
- especially used from RStudio
- Markdwon documents rendered in RSTudio automaticallyt linnk to the mathJax engin online
$$latex
s^{2} = \frac{\sum(x - \bar{x})^2}{n-1}
$$$latex s^{2} = \frac{\sum(x - \bar{x})^2}{n-1} $
Pandoc
- footnote
- bibliographies
- 2 ways
- command
- system
- knitr’s pandoc wrapper command
- command
- mechanism
- knit convert .Rmd to .md
- markdownToHTML from markdown package convert md to HTML
- ToHTML or reset markdownToHTML
- knit convert .Rmd to .md
- css
- look of the document
I getting started
1
intro to preproducible research
- research presents (ads) in
- slideshows
- journal articles
- books
- websites
- these documents are not the research
the research is
- full software environment, code , and data that produced the results
- When separating the research form its ads,
we are making it difficult for others to verify the findings by reproducing them
solution
- combine research with the presentation of findings
- workflow
- data gathering
- statistical analysis
- presentation of result
- tools
- R
- gather and analyze data
- Latex, Markdown
- create documents
- slideeshows
- articles
- books
- webpages
- create documents
- …
- knitr for R
- command line shell programs
- GNU Make
- Git version control
- RStudio
- R
reproducible research
- the data and code used to make a finding are available
and they are sufficient for an independent researcher to recreate the finding
- the data and code used to make a finding are available
advantage
- better work habits
- better teamwork
- changes are easier
- higher research impact
- cite more
2 sets of tools
reproducible research environment
- statistical tools
- the ability to automatically track the provenance of data, analyses,
and results and to package them for redistribution
reproducible research publisher
- prepare dynamic documents for presenting results
- easily linked to reproducible research environment
- tools covered in the book
- R
- knitr
- literate programming
- work with R, Bash, Python, and Ruby
- Markup language
- RStudio
- cloud storage & versioning
- dropbox
- Git/Github
- Unix-like shell programs
- GNU Make
- compiling projects
- mac
- Xcode
- windows
- included in Rtools
- Pandoc
- convert documents from one markup language to another
- GNU Make
- books
- The R Book
- R in Action
- Dynamic Documents with R and knitr
- The Art of R Programming: A Tour of Statistical Design Software
- The Linux Command Line: A complete Introduction
- intro to the command line in Linux and Mac
- Windows PwoerShell
- research presents (ads) in
2
- getting started with reproducible research: workflow
- start from beginning of research
- 3 basic stages of a typical computational empirical research project
- data gathering
- Part II
- data analyis
- Part III
- results presentation
- Part IV
- data gathering
packages used
install.packages(c(“apsrtable”, “brew”, “countrycode”,
"devtools", "digest", "formatR", "gdata",
"ggplot2", "googleVis", "httr", "knitcitations",
"knitr", "markdown", "openair", "plyr",
"quantmod", "repmis", "reshape2",
"RCurl", "rjson", "RJSONIO", "stargazer",
"texreg", "tools", "treebase",
"twitteR", "WDI", "XML",
"xtable", "Zelig"))
install.packages(“ZeligBayesian”, repos = “, type = “source”)
libarary(devtools)
install_github(“slidfy”, “ramnathv”)
install_github(“slidifyLibraries”, “ramnathv”)