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

Stable version

Current stable version is available on CRAN via

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

Development version

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

Bug/feature request

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

packageVersion("openxlsx")

News

Here.

Authors and Contributors for the current release

@awalker89, @aavanesy, @ale275, @alexb523, @david-f1976, @davidgohel, @dovrosenberg, @JoshuaSturm, @SHAESEN2, @soliac, @theclue, and @ycphs

Copy Link

Version

Install

install.packages('openxlsx')

Monthly Downloads

397,276

Version

4.2.4

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Philipp Schauberger

Last Published

June 16th, 2021

Functions in openxlsx (4.2.4)

addFilter

Add column filters
addWorksheet

Add a worksheet to a workbook
addCreator

Add another author to the meta data of the file.
buildWorkbook

Build Workbook
all.equal

Check equality of workbooks
activeSheet

Get/set active sheet of the workbook
cloneWorksheet

Clone a worksheet to a workbook
addStyle

Add a style to a set of cells
conditionalFormat

Add conditional formatting to cells
conditionalFormatting

Add conditional formatting to cells
dataValidation

Add data validation to cells
convertToDateTime

Convert from excel time number to R POSIXct type.
getCellRefs

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

Add another author to the meta data of the file.
copyWorkbook

Copy a Workbook object.
mergeCells

Merge cells within a worksheet
makeHyperlinkString

create Excel hyperlink string
createComment

create a Comment object
createNamedRegion

Create a named region.
getNamedRegions

Get named regions
getDateOrigin

Get the date origin an xlsx file is using
deleteData

Delete cell data
int2col

Convert integer to Excel column
openxlsx

xlsx reading, writing and editing.
openXL

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

Convert excel column name to integer index
convertToDate

Convert from excel date number to R Date type
pageSetup

Set page margins, orientation and print scaling
renameWorksheet

Rename a worksheet
pageBreak

add a page break to a worksheet
removeWorksheet

Remove a worksheet from a workbook
createWorkbook

Create a new Workbook object
getStyles

Returns a list of all styles in the workbook
createStyle

Create a cell style
insertImage

Insert an image into a worksheet
getSheetNames

Get names of worksheets
loadWorkbook

Load an existing .xlsx file
freezePane

Freeze a worksheet pane
getBaseFont

Return the workbook default font
names

get or set worksheet names
modifyBaseFont

Modify the default font
setHeader

Set header for all worksheets
read.xlsx

Read from an Excel file or Workbook object
replaceStyle

Replace an existing cell style
insertPlot

Insert the current plot into a worksheet
readWorkbook

Read from an Excel file or Workbook object
setColWidths

Set worksheet column widths
worksheetOrder

Order of worksheets in xlsx file
setFooter

Set footer for all worksheets
removeCellMerge

Create a new Workbook object
saveWorkbook

save Workbook to file
write.xlsx

write data to an xlsx file
writeData

Write an object to a worksheet
writeComment

write a cell comment
getTables

List Excel tables in a workbook
groupRows

Group Rows
groupColumns

Group columns
if_null_then

If NULL then ...
setLastModifiedBy

Add another author to the meta data of the file.
setRowHeights

Set worksheet row heights
removeColWidths

Remove column widths from a worksheet
removeFilter

Remove a worksheet filter
sheetVisible

Get worksheet visible state.
openxlsx_options

openxlsx Options
sheetVisibility

Get/set worksheet visible state
removeComment

Remove a comment from a cell
setHeaderFooter

Set document headers and footers
openxlsxFontSizeLookupTable

Font Size Lookup tables
writeFormula

Write a character vector as an Excel Formula
writeDataTable

Write to a worksheet as an Excel table
protectWorkbook

Protect a workbook from modifications
removeRowHeights

Remove custom row heights from a worksheet
ungroupColumns

Ungroup Columns
sheets

Returns names of worksheets.
showGridLines

Set worksheet gridlines to show or hide.
protectWorksheet

Protect a worksheet from modifications
removeTable

Remove an Excel table in a workbook
ungroupRows

Ungroup Rows