Title: Fast Utilities for Splitting Excel Sheets
Version: 0.1.0
Description: Provides tools for splitting large Excel worksheets into multiple smaller sheets based on a specified number of rows per chunk. The package reads Excel files, partitions the data efficiently using the 'data.table' package, and writes the resulting subsets into a single workbook with multiple sheets using the 'openxlsx' package. This is useful for handling large datasets, preparing data for reporting, and exporting manageable Excel files for downstream analysis.
License: MIT + file LICENSE
Encoding: UTF-8
Imports: data.table, openxlsx
RoxygenNote: 7.3.3
NeedsCompilation: no
Packaged: 2026-03-20 23:49:32 UTC; AfrologicInsect
Author: Daniel Amah [aut, cre]
Maintainer: Daniel Amah <danielamahtoday@gmail.com>
Repository: CRAN
Date/Publication: 2026-03-25 20:50:02 UTC

Split an Excel Sheet into Multiple Sheets

Description

Reads a source Excel file and splits rows into multiple sheets within a single workbook.

Usage

split_excel_to_sheets(
  file_path,
  n,
  sheet = 1,
  output_path = NULL,
  sheet_prefix = "Part",
  header_style = TRUE,
  col_widths = "auto"
)

Arguments

file_path

Path to source .xlsx file.

n

Number of chunks to split the data into.

sheet

Sheet name or index.

output_path

Optional path to save the workbook.

sheet_prefix

Prefix for sheet names.

header_style

Logical; whether to apply header styling.

col_widths

Column widths (numeric vector, "auto", or NULL).

Value

An openxlsx workbook object invisibly.

Examples


tmp <- tempfile(fileext = ".xlsx")
openxlsx::write.xlsx(data.frame(x = 1:10), tmp)

split_excel_to_sheets(tmp, n = 2)