title: ' R package rrtable
'
subtitle: ' Reproducible Research with a Table of R codes '
author: ' Keon-Woong Moon '
date: "2018-04-15"
output:
html_document:
keep_md: true
require(moonBook)
require(ztable)
require(rrtable)
require(ggplot2)
Introduction
If you are a data scientist or researcher, you will certainly be interested in reproducible research. R package rrtable
makes it possible to make reports with HTML, LaTex, MS word or MS Powerpoint formats from a table of R codes.
Package Installation
You can install R package rrtable
with the following command.
if(!require(devtools)){ install.packages("devtools") }
devtools::install_github("cardiomoon/rrtable")
Package Loading
You can load the rrtable
package with the following R command.
require(rrtable)
Sample Data
Sample data sampleData3 is included in rrtable package. You can see the sampleData3 by folllowing R command.
str(sampleData3)
'data.frame': 15 obs. of 5 variables:
$ type : chr "title" "subtitle" "author" "text" ...
$ title : chr "" "" "" "Introduction" ...
$ text : chr "R package `rrtable`" "Reproducible Research with a Table of R codes" "Keon-Woong Moon" "If you are a data scientist or researcher, you will certainly be interested in reproducible research. R package"| __truncated__ ...
$ code : chr "" "" "" "" ...
$ option: chr "" "" "" "" ...
Paragraph
You can make a paragraph with this data
df2flextable2( sampleData3 ,vanilla= FALSE )
devtools::install_github("cardiomoon/rrtable")echo=TRUE, eval=FALSEheader2Package LoadingYou can load the rrtable
package with the following R command.require(rrtable)echo=TRUEheader2Sample DataSample data sampleData3 is included in rrtable package. You can see the sampleData3 by folllowing R command.str(sampleData3)echo=TRUE, eval=TRUEDataParagraphYou can make a paragraph with this datasampleData3landscape=TRUEmytablemytable objectYou can add mytable object with the following R code.mytable(Dx~.,data=acs)plotPlotYou can insert a plot into your document.plot(Sepal.WidthSepal.Length,data=iris)ggplotggplotYou can insert a ggplot into a documentggplot(iris,aes(x=Sepal.Length,y=Sepal.Width,color=Species))+ geom_point()RcodeR codeYou can insert the result of R code. For example, you can insert the result of regression analysis.fit=lm(mpgwt*hp,data=mtcars)
summary(fit)2ggplotsTwo ggplotsYou can insert two parallel ggplots with the following code.ggplot(iris,aes(Sepal.Length,Sepal.Width))+geom_point()
ggplot(iris,aes(Sepal.Length,Sepal.Width,colour=Species))+ geom_point()+guides(colour=FALSE)2plotsTwo plotsYou can insert two parallel plots with the following code.<span style="font-family:'Arial';color:rgba(0,0,0,1.00);font-siz