⚠️There's a newer version (4.2.7) 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", "remotes"), dependencies = TRUE)
remotes::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.

Copy Link

Version

Install

install.packages('openxlsx')

Monthly Downloads

346,643

Version

4.2.6.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Last Published

July 23rd, 2024

Functions in openxlsx (4.2.6.1)

getBaseFont

Return the workbook default font
getCellRefs

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

List Excel tables in a workbook
createComment

create a Comment object
deleteData

Delete cell data
dataValidation

Add data validation to cells
getStyles

Returns a list of all styles in the workbook
insertImage

Insert an image into a worksheet
makeHyperlinkString

create Excel hyperlink string
loadWorkbook

Load an existing .xlsx file
freezePane

Freeze a worksheet pane
if_null_then

If NULL then ...
deleteDataColumn

Deletes a whole column from a workbook
int2col

Convert integer to Excel column
getNamedRegions

Get named regions
insertPlot

Insert the current plot into a worksheet
getSheetNames

Get names of worksheets
getDateOrigin

Get the date origin an xlsx file is using
groupColumns

Group columns
getCreators

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

xlsx reading, writing and editing.
openxlsx_options

openxlsx Options
pageBreak

add a page break to a worksheet
mergeCells

Merge cells within a worksheet
readWorkbook

Read from an Excel file or Workbook object
removeCellMerge

Create a new Workbook object
names

get or set worksheet names
openXL

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

Remove column widths from a worksheet
removeTable

Remove an Excel table in a workbook
protectWorksheet

Protect a worksheet from modifications
groupRows

Group Rows
modifyBaseFont

Modify the default font
read.xlsx

Read from an Excel file or Workbook object
setFooter

Set footer for all worksheets
removeComment

Remove a comment from a cell
setHeaderFooter

Set document headers and footers
setLastModifiedBy

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

Remove a worksheet from a workbook
pageSetup

Set page margins, orientation and print scaling
protectWorkbook

Protect a workbook from modifications
worksheetOrder

Order of worksheets in xlsx file
setRowHeights

Set worksheet row heights
showGridLines

Set worksheet gridlines to show or hide.
sheetVisibility

Get/set worksheet visible state
setHeader

Set header for all worksheets
saveWorkbook

save Workbook to file
writeComment

write a cell comment
writeData

Write an object to a worksheet
openxlsxFontSizeLookupTable

Font Size Lookup tables
removeFilter

Remove a worksheet filter
sheets

Returns names of worksheets.
setColWidths

Set worksheet column widths
renameWorksheet

Rename a worksheet
replaceStyle

Replace an existing cell style
write.xlsx

write data to an xlsx file
writeFormula

Write a character vector as an Excel Formula
sheetVisible

Get worksheet visible state.
ungroupRows

Ungroup Rows
removeRowHeights

Remove custom row heights from a worksheet
ungroupColumns

Ungroup Columns
temp_xlsx

helper function to create tempory directory for testing purpose
writeDataTable

Write to a worksheet as an Excel table
addStyle

Add a style to a set of cells
all.equal

Check equality of workbooks
buildWorkbook

Build Workbook
cloneWorksheet

Clone a worksheet to a workbook
addCreator

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

Get/set active sheet of the workbook
createNamedRegion

Create / delete a named region.
as.character.formula

as.character.formula()
addWorksheet

Add a worksheet to a workbook
addFilter

Add column filters
col2int

Convert Excel column to integer
convertToDateTime

Convert from excel time number to R POSIXct type.
createStyle

Create a cell style
conditionalFormat

Add conditional formatting to cells
copyWorkbook

Copy a Workbook object.
convertFromExcelRef

Convert excel column name to integer index
convertToDate

Convert from excel date number to R Date type
conditionalFormatting

Add conditional formatting to cells
createWorkbook

Create a new Workbook object