Learn R Programming

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.7

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Last Published

August 30th, 2024

Functions in openxlsx (4.2.7)

convertToDateTime

Convert from excel time number to R POSIXct type.
convertFromExcelRef

Convert excel column name to integer index
createStyle

Create a cell style
getCellRefs

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

Return the workbook default font
getCreators

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

Group Rows
getDateOrigin

Get the date origin an xlsx file is using
groupColumns

Group columns
if_null_then

If NULL then ...
get_worksheet_entries

Get entries from workbook worksheet
getNamedRegions

Get named regions
insertImage

Insert an image into a worksheet
deleteDataColumn

Deletes a whole column from a workbook
dataValidation

Add data validation to cells
deleteData

Delete cell data
names

get or set worksheet names
freezePane

Freeze a worksheet pane
insertPlot

Insert the current plot into a worksheet
modifyBaseFont

Modify the default font
getSheetNames

Get names of worksheets
getTables

List Excel tables in a workbook
getStyles

Returns a list of all styles in the workbook
mergeCells

Merge cells within a worksheet
removeFilter

Remove a worksheet filter
makeHyperlinkString

create Excel hyperlink string
removeComment

Remove a comment from a cell
createWorkbook

Create a new Workbook object
int2col

Convert integer to Excel column
openxlsx_options

openxlsx Options
protectWorkbook

Protect a workbook from modifications
removeCellMerge

Create a new Workbook object
loadWorkbook

Load an existing .xlsx file
openxlsxFontSizeLookupTable

Font Size Lookup tables
removeColWidths

Remove column widths from a worksheet
setHeader

Set header for all worksheets
protectWorksheet

Protect a worksheet from modifications
openXL

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

Read from an Excel file or Workbook object
readWorkbook

Read from an Excel file or Workbook object
setRowHeights

Set worksheet row heights
setLastModifiedBy

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

Rename a worksheet
removeWorksheet

Remove a worksheet from a workbook
setHeaderFooter

Set document headers and footers
sheets

Returns names of worksheets.
temp_xlsx

helper function to create tempory directory for testing purpose
showGridLines

Set worksheet gridlines to show or hide.
sheetVisible

Get worksheet visible state.
worksheetOrder

Order of worksheets in xlsx file
setWindowSize

Set and Get Window Size for xlsx file
write.xlsx

write data to an xlsx file
pageBreak

add a page break to a worksheet
sheetVisibility

Get/set worksheet visible state
setFooter

Set footer for all worksheets
openxlsx

xlsx reading, writing and editing.
setColWidths

Set worksheet column widths
pageSetup

Set page margins, orientation and print scaling
writeComment

write a cell comment
saveWorkbook

save Workbook to file
writeData

Write an object to a worksheet
replaceStyle

Replace an existing cell style
removeRowHeights

Remove custom row heights from a worksheet
removeTable

Remove an Excel table in a workbook
ungroupColumns

Ungroup Columns
ungroupRows

Ungroup Rows
writeDataTable

Write to a worksheet as an Excel table
writeFormula

Write a character vector as an Excel Formula
createNamedRegion

Create / delete a named region.
addCreator

Add another author to the meta data of the file.
all.equal

Check equality of workbooks
addStyle

Add a style to a set of cells
addWorksheet

Add a worksheet to a workbook
activeSheet

Get/set active sheet of the workbook
as_POSIXct_utc

Convert to POSIXct with timezone UTC
as.character.formula

as.character.formula()
auto_heights

Compute optimal row heights
addFilter

Add column filters
copyWorkbook

Copy a Workbook object.
conditionalFormatting

Add conditional formatting to cells
convertToDate

Convert from excel date number to R Date type
buildWorkbook

Build Workbook
col2int

Convert Excel column to integer
createComment

create a Comment object
cloneWorksheet

Clone a worksheet to a workbook
conditionalFormat

Add conditional formatting to cells