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

340,340

Version

4.2.7.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Last Published

September 20th, 2024

Functions in openxlsx (4.2.7.1)

conditionalFormat

Add conditional formatting to cells
getCreators

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

Convert Excel column to integer
getBaseFont

Return the workbook default font
getCellRefs

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

Deletes a whole column from a workbook
convertToDateTime

Convert from excel time number to R POSIXct type.
freezePane

Freeze a worksheet pane
convertToDate

Convert from excel date number to R Date type
getSheetNames

Get names of worksheets
cloneWorksheet

Clone a worksheet to a workbook
if_null_then

If NULL then ...
getNamedRegions

Get named regions
buildWorkbook

Build Workbook
copyWorkbook

Copy a Workbook object.
createStyle

Create a cell style
createWorkbook

Create a new Workbook object
createComment

create a Comment object
makeHyperlinkString

create Excel hyperlink string
getTables

List Excel tables in a workbook
getDateOrigin

Get the date origin an xlsx file is using
getStyles

Returns a list of all styles in the workbook
names

get or set worksheet names
modifyBaseFont

Modify the default font
dataValidation

Add data validation to cells
removeComment

Remove a comment from a cell
mergeCells

Merge cells within a worksheet
removeFilter

Remove a worksheet filter
protectWorkbook

Protect a workbook from modifications
get_worksheet_entries

Get entries from workbook worksheet
groupColumns

Group columns
int2col

Convert integer to Excel column
protectWorksheet

Protect a worksheet from modifications
loadWorkbook

Load an existing .xlsx file
renameWorksheet

Rename a worksheet
removeWorksheet

Remove a worksheet from a workbook
saveWorkbook

save Workbook to file
ungroupColumns

Ungroup Columns
read.xlsx

Read from an Excel file or Workbook object
insertImage

Insert an image into a worksheet
replaceStyle

Replace an existing cell style
insertPlot

Insert the current plot into a worksheet
openxlsxFontSizeLookupTable

Font Size Lookup tables
sheetVisibility

Get/set worksheet visible state
removeCellMerge

Create a new Workbook object
setWindowSize

Set and Get Window Size for xlsx file
openxlsx_options

openxlsx Options
removeTable

Remove an Excel table in a workbook
removeRowHeights

Remove custom row heights from a worksheet
write.xlsx

write data to an xlsx file
readWorkbook

Read from an Excel file or Workbook object
setRowHeights

Set worksheet row heights
worksheetOrder

Order of worksheets in xlsx file
ungroupRows

Ungroup Rows
setLastModifiedBy

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

write a cell comment
deleteData

Delete cell data
openXL

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

add a page break to a worksheet
groupRows

Group Rows
removeColWidths

Remove column widths from a worksheet
setHeader

Set header for all worksheets
sheetVisible

Get worksheet visible state.
setColWidths

Set worksheet column widths
writeDataTable

Write to a worksheet as an Excel table
temp_xlsx

helper function to create tempory directory for testing purpose
setFooter

Set footer for all worksheets
pageSetup

Set page margins, orientation and print scaling
openxlsx

xlsx reading, writing and editing.
sheets

Returns names of worksheets.
setHeaderFooter

Set document headers and footers
writeData

Write an object to a worksheet
writeFormula

Write a character vector as an Excel Formula
showGridLines

Set worksheet gridlines to show or hide.
all.equal

Check equality of workbooks
as.character.formula

as.character.formula()
createNamedRegion

Create / delete a named region.
activeSheet

Get/set active sheet of the workbook
addCreator

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

Convert to POSIXct with timezone UTC
addFilter

Add column filters
auto_heights

Compute optimal row heights
conditionalFormatting

Add conditional formatting to cells
convertFromExcelRef

Convert excel column name to integer index
addStyle

Add a style to a set of cells
addWorksheet

Add a worksheet to a workbook