If you've ever thought, "I wish R could do X automatically," I have a story for you. Recently, I embarked on a journey to create my first R package — and let me tell you, it was one of the most fun and educational experiences in my coding career.
The goal? Build splitr , a package that splits an Excel sheet into multiple sheets effi ciently, using data.table for speed and openxlsx for Excel magic.
Step 1: The Idea and the Blueprint
It all started with a common pain point: dealing with massive Excel files. Manually splitting data into chunks for reporting or analysis was tedious.
I sketched out the plan:
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
Simple, right? But turning that plan into a robust, reusable R function is where the fun begins.
🛠 Step 2: Structuring the Package
Using RStudio , I created a new package project called splitr .…