The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

Getting Started with rapidxlsx

The rapidxlsx package provides high-throughput serialization of R data frames to Microsoft Excel (.xlsx) workbooks. It utilizes a multi-threaded Rust engine with zero-copy SEXP vector ingestion and parallel Deflate block compression (Z_SYNC_FLUSH).

Basic Usage

The primary function is write_xlsx(). It takes a data.frame and an output file path:

library(rapidxlsx)

df <- data.frame(
  id = 101:105,
  name = c("Alice", "Bob", "Charlie", "David", "Eva"),
  score = c(95.5, 88.0, 92.3, 76.4, 89.1),
  active = c(TRUE, FALSE, TRUE, TRUE, FALSE),
  group = factor(c("A", "B", "A", "C", "B")),
  stringsAsFactors = FALSE
)

tmp <- tempfile(fileext = ".xlsx")
write_xlsx(df, tmp, sheet_name = "Participants")

The function returns the path invisibly, enabling standard R piping (|> or %>%):

out_path <- df |>
  subset(active == TRUE) |>
  write_xlsx(tempfile(fileext = ".xlsx"), sheet_name = "ActiveUsers")

file.exists(out_path)
#> [1] TRUE

Missing Values

Missing values (NA, NA_real_, NA_integer_, NA_character_) are mapped to empty OpenXML cells:

data_with_na <- data.frame(
  x = c(1.0, NA, 3.5),
  y = c("valid", "text", NA),
  stringsAsFactors = FALSE
)

tmp_na <- tempfile(fileext = ".xlsx")
write_xlsx(data_with_na, tmp_na)

Compression Level

The compression_level argument accepts integers from 1 to 9 (default 1L):

tmp_comp <- tempfile(fileext = ".xlsx")
write_xlsx(df, tmp_comp, compression_level = 6L)

Clean Up

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.