readme.md

RcppXLSXwriter

Project Status: WIP ? Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. Travis-CI Build Status

This package uses John McNamara's C library libxlsxwriter and Rcpp to let R users generate customized XLSX files in R. The WriteXLS package on CRAN is nice, but it requires Perl, and it isn't flexible enough to allow the user to fully customize their Excel output.

With RcppXLSXwriter you have the ability to customize each and every cell in your XLSX document.

Issues

Portability

So far I have only been able to get the package to build on 32-bit R on Windows.

Usage

Although RcppXLSXwriter only has its bare infrastructure, you still get most of the functionality of libxlsxwriter if you're willing to be verbose.

Here is a quick example for writing iris with bold, exciting header:

library(RcppXLSXwriter)

# create workbook
wb <- new(XLSXworkbook, "newFile.xlsx")

# create worksheet
ws <- new(XLSXworksheet, wb, "firstSheet")

# create format for title
titleFmt <- new(XLSXformat, wb)

# set format to font 24, times new roman, bold, underline, and italic
titleFmt$font_size(24)
titleFmt$font_name("times new roman")
titleFmt$bold()
titleFmt$underline()
titleFmt$italic()

# write title
ws$writef(1,seq_len(ncol(iris)),t(as.matrix(names(iris))),titleFmt)

# write data
ws$write(1+seq_len(nrow(iris)),seq_len(ncol(iris)),as.matrix(iris))

# close
wb$close()


carlganz/RcppXLSXwriter documentation built on May 13, 2019, 12:44 p.m.