From Idea to CRAN: My Journey Building the `splitr` R Package

Published: (March 8, 2026 at 11:24 AM EDT)
1 min read
Source: Dev.to

Source: Dev.to

Step 1: The Idea and the Blueprint

If you’ve ever thought, “I wish R could do X automatically,” I have a story for you. I embarked on a journey to create my first R packagesplitr—which splits an Excel sheet into multiple sheets efficiently, using data.table for speed and openxlsx for Excel handling.

The goal

  • Read a source Excel sheet
  • Split rows into n chunks
  • Write each chunk into a separate sheet in a single workbook
  • Apply styles and optionally save to disk

Step 2: Structuring the Package

Using RStudio, I created a new package project called splitr. The basic structure looks like this:

splitr/
├── R/
│   └── split_excel_to_sheets.R
├── man/
├── DESCRIPTION
├── NAMESPACE
└── splitr.Rproj
  • DESCRIPTION holds metadata about the package.
  • R/ is where the actual function lives.
  • man/ will eventually contain documentation generated with roxygen2.

Step 3: Writing the Function

Here’s the core of splitr:

split_excel_to_sheets   

Note: CRAN submission is still in progress, so GitHub is the best way to try it right now.

0 views
Back to Blog

Related posts

Read more »