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.

For Linux and MacOS this should be available by default.

For Windows, zip can be installed by installing Rtools

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

Please let me know which version of openxlsx you are using when posting bug reports.

packageVersion("openxlsx")

Thanks, here.

News

Here.

Authors and Contributors

A list is automagically maintained here.

Copy Link

Version

Install

install.packages('openxlsx')

Monthly Downloads

376,325

Version

4.0.17

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Alexander Walker

Last Published

March 23rd, 2017

Functions in openxlsx (4.0.17)

openXL

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

Returns names of worksheets.
addFilter

Add column filters
addStyle

Add a style to a set of cells
readWorkbook

Read from an Excel file or Workbook object
convertToDateTime

Convert from excel time number to R POSIXct type.
copyWorkbook

Copy a Workbook object.
getCellRefs

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

Get the date origin an xlsx file is using
getStyles

Returns a list of all styles in the workbook
getTables

List Excel tables in a workbook
removeTable

Remove an Excel table in a workbook
removeRowHeights

Remove custom row heights from a worksheet
write.xlsx

write data to an xlsx file
writeComment

write a cell comment
conditionalFormat

Add conditional formatting to cells
conditionalFormatting

Add conditional formatting to cells
loadWorkbook

Load an exisiting .xlsx file
int2col

Convert integer to Excel column
read.xlsx

Read from an Excel file or Workbook object
setColWidths

Set worksheet column widths
setFooter

Set footer for all worksheets
addWorksheet

Add a worksheet to a workbook
convertFromExcelRef

Convert excel column name to integer index
freezePane

Freeze a worksheet pane
getBaseFont

Return the workbook default font
insertImage

Insert an image into a worksheet
all.equal

Check equality of workbooks
createNamedRegion

Create a named region.
createComment

create a Comment object
pageSetup

Set page margins, orientation and print scaling
pageBreak

add a page break to a worksheet
insertPlot

Insert the current plot into a worksheet
createStyle

Create a cell style
makeHyperlinkString

create Excel hyperlink string
convertToDate

Convert from excel date number to R Date type
createWorkbook

Create a new Workbook object
removeWorksheet

Remove a worksheet from a workbook
showGridLines

Set worksheet gridlines to show or hide.
renameWorksheet

Rename a worksheet
dataValidation

Add data validation to cells
deleteData

Delete cell data
mergeCells

Merge cells within a worksheet
modifyBaseFont

Modify the default font
worksheetOrder

Order of worksheets in xlsx file
names

get or set worksheet names
getNamedRegions

Get named regions
getSheetNames

Get names of worksheets
removeComment

Remove a comment from a cell
removeFilter

Remove a worksheet filter
removeCellMerge

Create a new Workbook object
sheetVisible

Get worksheet visible state.
setHeader

Set header for all worksheets
removeColWidths

Remove column widths from a worksheet
writeFormula

Write a character vector as an Excel Formula
replaceStyle

Replace an existing cell style
setRowHeights

Set worksheet row heights
saveWorkbook

save Workbook to file
setHeaderFooter

Set document headers and footers
sheetVisibility

Get/set worksheet visible state
writeDataTable

Write to a worksheet as an Excel table
openxlsx

xlsx reading, writing and editing.
writeData

Write an object to a worksheet