Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwenseleers committed Jul 13, 2015
1 parent 5a6bb1c commit 5f03bd9
Show file tree
Hide file tree
Showing 3 changed files with 152 additions and 2 deletions.
44 changes: 44 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Package: export
Type: Package
Title: Easy export of R graphs and statistical output to Microsoft Office, HTML and Latex
Version: 0.2
Date: 2015-07-10
Author: Tom Wenseleers [aut, cre]
Maintainer: Tom Wenseleers <[email protected]>
Depends:
R (>= 3.0),
ReporteRs (>= 0.7),
ReporteRsjars (>= 0.0.2),
rtable (>= 0.1),
xtable (>= 1.7),
taRifx (>= 1.0),
tikzDevice (>= 0.8)
Suggests:
lattice,
latticeExtra,
ggplot2,
afex,
effects,
gmodels,
MASS,
car,
nlme,
lmerTest,
survival,
zoo
Description: Package to export R graphs and R stats objects to Microsoft Word,
Microsoft Powerpoint and HTML Documents. Export uses packages ReporteRs,
xtable and rtable as a backbone. All export is in native Microsoft Office format
-- editable DrawingML vector format for graphs and tables for R stats objects (e.g.
anova, linear regression, GLM or lme4 mixed model output tables), and can use corporate
template documents for styling. The two main functions enable the currently
showing R graph or the currently showing R stats object to be exported in MS Office
format using a single command. The package does not require any installation of Microsoft
product to be able to write Microsoft files (docx and pptx) and output files are also
fully compatible with LibreOffice. The two main application areas of this package
are producing standardized reports and being able to manually edit the layout of
R graphs in vector format using Powerpoint. Base R, ggplot2, lattice and grid plots
are supported, as well as all the most common R stats objects, including aov, lm,
glm, lme, lmer, glmer, coxph, ftable, xtabs, ts, zoo and prcomp output as well
as tables, matrices and data frames.
License: GPL-2
21 changes: 21 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export(graph2office)
export(graph2ppt)
export(graph2doc)
export(graph2html)
export(graph2bitmap)
export(graph2png)
export(graph2tiff)
export(graph2tif)
export(graph2jpeg)
export(graph2jpg)
export(graph2vector)
export(graph2svg)
export(graph2pdf)
export(graph2eps)
export(graph2tex)
export(graph2tex2)
export(table2office)
export(table2ppt)
export(table2tex)
export(table2html)
export(table2doc)
89 changes: 87 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,87 @@
# export
R package export
export
======
export is an R package to easily export R graphs and statistical output to Microsoft Office, HTML and Latex.

Usefull links:

* Report a bug:
[**Bug report**]
(http://github.com/tomwenseleers/export/issues "please provide a reproducible example").
If you report a bug, try to send a reproducible example and don't forget to send the result of

sessionInfo()

Features
--------
* Save active R graphs or ggplot2, lattice or base R plots in Microsoft Word, Powerpoint,
HTML, Latex or various other bitmap or vector formats using a single command.
* Fully editable Powerpoint vector format output, enabling manual tidy-up of plot layout.
* Save the output of statistical analysis in R as tables in Word, PowerPoint or HTML documents.
* Customize formatting of R outputs.

Installation
------------

### Dependencies

Java (it has been tested with java version >= 1.6).

export needs some R packages ; run the following script to install them if needed.

install.packages("rJava")
install.packages("ReporteRs")
install.packages("ReporteRsjars")
install.packages("ggplot2")
install.packages("rtable")
install.packages("xtable")
install.packages("taRifx")
install.packages("stargazer")
install.packages("tikzDevice")


### Github

**Get the latest release:**

install.packages("devtools")
library(devtools)
devtools::install_github('tomwenseleers/export',local=F)


Getting Started
---------------

library(export)
?graph2ppt
?table2doc
?graph2tex
?table2tex
?graph2svg
?graph2png

## export of ggplot2 plot
library(ggplot2)
qplot(Sepal.Length, Petal.Length, data = iris, color = Species,
size = Petal.Width, alpha = I(0.7))
graph2ppt(file="ggplot2 plot.pptx", aspectr=1.7)

# add 2nd slide with same graph in different aspect ratio
graph2ppt(file="ggplot2 plot.pptx", aspectr=1.3, append=T)
# add 3d slide with same graph with fixed width & height
graph2ppt(file="ggplot2 plot.pptx", width=6, height=5, append=T)

# export of aov Anova output
fit=aov(yield ~ block + N * P + K, npk)
summary(fit)
table2doc(file="table_aov.docx")
summary(fit)
table2doc(file="table_aov.docx",append=T,digits=4)
summary(fit)
table2doc(file="table_aov.docx",append=T,digits=4,digitspvals=1)
summary(fit)
table2html(file="table_aov.html")

License
-------
The export package is licensed under the GPLv2.

0 comments on commit 5f03bd9

Please sign in to comment.