Learn R Programming


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

Copy Link

Version

Install

install.packages('rrtable')

Monthly Downloads

1,682

Version

0.1.0

License

GPL-3

Maintainer

KeonWoong Moon

Last Published

July 27th, 2018

Functions in rrtable (0.1.0)

Rcode2flextable

Make a flextable object with character strings encoding R code
data2HTML

Make a HTML5 file with a data.frame
add_2plots

Add two plots into a document object
add_img

Add plot into a document object
add_title

Add title to docx file
data2pdf

Make a pdf file with a data.frame
flextable2ztable

Convert flextable to ztable
data2office

convert data to pptx file
add_plot

Add plot into a document object
add_title_slide

Add title slide
html2latex

Convert html5 code to latex
plotPNG2

Make png file with a plot code
plotSVG2

Make SVG file with a plot code
add_self

add self data to document
insert_argument

replace argument of a function
df2RcodeTable

Make a flextable with a data.frame
add_flextable

Add a flextable or mytable object into a document object
add_text

Add text to document
data2docx

convert data to docx file
df2flextable

Convert data.frame to flextable
pptxList

Server function of pptxList shiny module
mygrep

grep string in all files in subdirectory
mycat

Concatenate to file
myplot2

Make zipped plots with a data.frame
readComment

Read comment from a file
add_text2hyperlink

Add hyperlink text
ztable2

Make ztable with desired width
pptxListInput

UI of pptxList shiny module
replace_argument

replace argument of a function
data2plotzip

Make zipped plot file with a data.frame
sampleData3

Sample data for pptxList A dataset containing five objects for reproducible research
data2pptx

convert data to pptx file
mytable2flextable

Convert mytable object to flextable
roundDf

Convert numeric columns of data.frame to character
set_argument

set argument of a function
plotPDF2

Make pdf file with a plot code
tensiSplit

Split strings with desired length with exdent
sampleData2

Sample data for pptxList A dataset containing five objects for reproducible research
writeCSVComment

Write a csv file with comment
HTMLcode2latex

Convert HTML table to latex table
Rcode2df

Make a data.frame with character strings encoding R code
add_ggplot

Add ggplot into a document object
add_2ggplots

Add two ggplots into a document object
add_2flextables

Add two flextables into a document object
df2flextable2

Make flextable with limited width
exportCSV

Export pptxList file to desired format
add_Rcode

Make a R code slide into a document object