Learn R Programming

⚠️There's a newer version (4.2.8) of this package.Take me there.

openxlsx

This R package simplifies the creation of .xlsx files by providing a high level interface to writing, styling and editing worksheets. Through the use of Rcpp, read/write times are comparable to the xlsx and XLConnect packages with the added benefit of removing the dependency on Java.

Installation

The openxlsx package requires a zip application to be available to R, such as the one that comes with Rtools, available here. (Windows only)

If the command

shell("zip")

returns

'zip' is not recognized as an internal or external command, operable program or
batch file.

or similar. Then;

the system PATH during installation.

  • If Rtools is installed, add the Rtools bin directory paths (default installation paths are

c:\Rtools\bin and c:\Rtools\gcc-4.6.3\bin) to the system PATH variable.

Stable version

Current stable version is available on CRAN via

install.packages("openxlsx", dependencies=TRUE)

Development version

Development version can be installed via GitHub once Rtools (Windows only) has been setup with:

install.packages(c("Rcpp", "devtools"), dependencies=TRUE)
require(devtools)
install_github("awalker89/openxlsx")

Bug/feature request

Thanks, here.

News

Here.

Authors and Contributors

A list is automagically maintained here.

Copy Link

Version

Install

install.packages('openxlsx')

Monthly Downloads

397,276

Version

3.0.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Alexander Walker

Last Published

July 3rd, 2015

Functions in openxlsx (3.0.0)

convertToDate

Convert from excel date number to R Date type
freezePane

Freeze a worksheet pane
getSheetNames

Returns the worksheet names within an xlsx file
removeRowHeights

Remove custom row heights from a worksheet
removeComment

Remove a comment from a cell
deleteData

Delete cell data
saveWorkbook

save Workbook to file
mergeCells

Merge cells within a worksheet
pageSetup

Set page margins, orientation and print scaling
loadWorkbook

Load an exisiting .xlsx file
showGridLines

Set worksheet gridlines to show or hide.
convertFromExcelRef

Convert excel column name to integer index
int2col

Convert integer to Excel column
conditionalFormat

Add conditional formatting to cells
replaceStyle

Replace an existing cell style
getBaseFont

Return the workbook defaul font
createWorkbook

Create a new Workbook object
createStyle

Create a cell style
getNamedRegions

Get named regions in an xlsx file.
removeCellMerge

Create a new Workbook object
readWorkbook

Read data from a worksheet into a data.frame
addStyle

Add a style to a set of cells
writeDataTable

Write to a worksheet and format as a table
insertImage

Insert an image into a worksheet
setFooter

Set footer for all worksheets
getCellRefs

Return excel cell coordinates from (x,y) coordinates
writeFormula

Write a character vector as an Excel Formula
sheets

Returns names of worksheets.
createComment

write a cell comment
read.xlsx

Read data from an Excel file or Workbook object into a data.frame
setColWidths

Set worksheet column widths
writeComment

write a cell comment
convertToDateTime

Convert from excel time number to R POSIXct type.
removeWorksheet

Remove a worksheet from a workbook
setHeaderFooter

Set document headers and footers
getDateOrigin

Return the date origin used internally by an xlsx or xlsm file
openxlsx

xlsx reading, writing and editing.
all.equal

Check equality of workbooks
removeFilter

removes worksheet filter from addFilter and writeData
conditionalFormatting

Add conditional formatting to cells
setHeader

Set header for all worksheets
addWorksheet

Add a worksheet to a workbook
insertPlot

Insert the current plot into a worksheet
modifyBaseFont

Modify the default font
setRowHeights

Set worksheet row heights
removeColWidths

Remove custom column widths from a worksheet
getStyles

Returns a list of all styles in the workbook
writeData

Write an object to a worksheet
renameWorksheet

Rename an exisiting worksheet
worksheetOrder

Order of worksheets in xlsx file
names

get or set worksheet names
addFilter

add filters to columns
openXL

Open a Microsoft Excel file (xls/xlsx) or an openxlsx Workbook
write.xlsx

write directly to an xlsx file