MyNixOS website logo
Description

Export or Graph and Tables to 'Microsoft' Office and Import Figures and Tables.

Provides wrap functions to export and import graphics and data frames in R to 'microsoft' office. And This package also provide write out figures with lots of different formats. Since people may work on the platform without GUI support, the package also provide function to easily write out figures to lots of different type of formats. Now this package provide function to extract colors from all types of figures and pdf files.

eoffice

Export and import graphics and tables to MicroSoft office

Description

eoffice provide wrap functions to export and import graphics and data.frames in R to MicroSoft office with fully editable figures and tables(docx, pptx format). And eoffice also provide write out figures with lots of different formats, such as pdf, eps, emf, tiff, svg, wmf, png and jpeg. eoffice also support write out or display ggplot2 type figure with plotly. Since people may work on the platform without GUI support, eoffice also provide function to easily write out figures to all above formats, pptx and docx.eoffice is avaiable on CRAN now. eoffice provides function to extract colors from figures with different formats or pdf files. For linux platform please install imageMagick to use the infigure function.

on Debian/Ubuntu this is called libmagick++-dev:
sudo apt-get install libmagick++-dev
On Fedora or CentOS/RHEL we need ImageMagick-c++-devel:
sudo yum install ImageMagick-c++-devel
If you can't install the ImageMagick you can go with eoffice 0.1.6 version

Installation

library(devtools)
## install_github("guokai8/eoffice")
## eoffice is available on CRAN
install.packages("eoffice")

Software Usage

library(eoffice)
library(ggplot2)
## make a figure with you custom function
plot(mtcars$mpg, mtcars$disp)
topptx(filename = "mtcars.pptx")
## You can also use ggplot 
ggplot(mtcars, aes(mpg, disp, color = factor(cyl))) + geom_point()
topptx(filename = "mtcars.pptx")
## or todocx(filename = "mtcars.docx")
p <- ggplot(mtcars, aes(mpg, disp, color = factor(cyl))) + geom_point()
topptx(p, filename = "mtcars.pptx", width = 6, height = 4)
## use above method if you want use topptx with ggplot function in a loop
## write out table to office
totable(head(mtcars), filename = "mtcars.docx")
totable(head(mtcars), filename = "mtcars.pptx")
## append was supported if you want add figures or tables.
## Now support direct output of common objects produced by R statistical functions
tt <- t.test(wt ~ am, mtcars)
totable(tt, filename = "mtcars_test.pptx")
totable(t.test(wt ~ am, mtcars), filename = "mtcars_test.pptx")
## inpptx and indocx provide function read the tables in pptx or docx
tabs <- inpptx(filename = "mtcars.pptx", header = TRUE)
## output different figure formats
tofigure(ggplot(mtcars, aes(mpg, disp, color = factor(cyl))) + geom_point(),filename = "mtcars.pdf")
tofigure(ggplot(mtcars, aes(mpg, disp, color = factor(cyl))) + geom_point(),filename = "mtcars.eps")
## display figure with plotly
tohtml(p, save = FALSE)
## if you use basic plot function or other plot function you need first use convertplot to convert 
## it to ggplot object when you are working on the platform without GUI
p <- convertplot(plot(1:10))
tofigure(p, filename = "test.pdf")
topptx(p, filename = "test.pptx")
## if you use ggplot like function you don't need to transform the format

Note

The eoffice just a package for funs. eoffice depends on officer and rvg package which include lots of fantastic functions. Here, eoffice provides simplified functions which could be save some time to learn the complete functions from above packages. And there are some other packages provide these functions. Comparing with these packages, eoffice include own features which I think really helpful to me. Besides, eoffice also provide functions to read tables from pptx and docx. Read graphics and extract colors from the figures are available now.

Contact information

For any questions please contact [email protected].

Metadata

Version

0.2.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows