Using R package structure for data science projects | Kylie Ainslie | Data Science Lab @PositPBC
Using R package structure for data science projects | Kylie Ainslie | Data Science Lab  @PositPBC
Uploaded February 2026 | Updated November 2026, 11 hours ago
The Data Science Lab is a live weekly call. Register at pos.it/dslab! Discord invites go out each week on lives calls. We'd love to have you!

The Lab is an open, messy space for learning and asking questions. Think of it like pair coding with a friend or two. Learn something new, and share what you know to help others grow.

On this call, Libby Heeren is joined by Kylie Ainslie who walks through how structuring data science projects as R packages provides a consistent framework that integrates documentation for you and facilitates collaboration with others by organizing things really well. Kylie says, "I stumbled on using an R package structure to organize my projects a number of years ago and it has changed how I work in such a positive way that I want to share it with others! In a world where our attention is constantly being pulled in many directions, efficiency is crucial. Structuring projects as R packages is how I work more efficiently."

Hosting crew from Posit: Libby Heeren, Isabella Velasquez

Kylie's Bluesky: @kylieainslie.bsky.social
Kylie's LinkedIn: linkedin.com/in/kylieainslie
Kylie's Website: kylieainslie.github.io
Kylie's GitHub: github.com/kylieainslie

Resources from the hosts and chat:

๐Ÿ”— posit::conf(2026) call for talks: posit.co/blog/posit-conf-2026-call-for-talks
๐Ÿ”— Kylie's posit::conf(2025) talk: youtube.com/watch?v=YzIiWg4rySA
๐Ÿ”— {usethis} package: usethis.r-lib.org
๐Ÿ”— R Packages (2e) book: r-pkgs.org
๐Ÿ”— Paquetes de R (R Packages in Spanish):
davidrsch.github.io/rpkgs-es
๐Ÿ”— {box} package: github.com/klmr/box
๐Ÿ”— extdata docs in Writing R Extensions: cran.r-project.org/doc/manuals/R-exts.html#Data-in-packages-1
๐Ÿ”— Tan Ho's talk on NFL data: tanho.ca/talks/rsconf2022-github
๐Ÿ”— {rv} package: a2-ai.github.io/rv-docs
๐Ÿ”— Whether to Import or Depend: r-pkgs.org/dependencies-mindset-background.html#sec-dependencies-imports-vs-depends
๐Ÿ”— {pkgdown} package: pkgdown.r-lib.org
๐Ÿ”— Edgar Ruiz's {pkgsite} package: github.com/edgararuiz/pkgsite

Attendees shared examples of data packages in the chat! Here they are:
kjhealy.github.io/nycdogs
kjhealy.github.io/gssr
github.com/deepshamenghani/richmondway
github.com/kyleGrealis/nascaR.data
github.com/ivelasq/leaidr

โ–บ Subscribe to Our Channel Here: bit.ly/2TzgcOu

Follow Us Here:
Website: posit.co
The Lab: https://pos.it/dslab
Hangout: https://pos.it/dsh
LinkedIn: linkedin.com/company/posit-software
Bluesky: https://bsky.app/profile/posit.co

Thanks for learning with us! ๐Ÿ’›

Timestamps:
00:00 Introduction
06:17 Reviewing the disorganized project example
10:01 Creating the package structure using create_package
17:50 Organizing external data and scripts in the inst folder
22:55 Adding a README and License
29:06 "What are the advantages to packaging a project?"
33:35 Writing Roxygen2 documentation
36:06 "Do you type return at the end of your functions?"
41:55 Handling dependencies with use_package
43:53 "Can you just use require(dplyr) at the top?"
47:45 Setting up a pkgdown site
50:11 Creating vignettes
52:22 "What is the role of the usethis package?"
54:18 Loading the package with devtools::load_all
Using R package structure for data science projects | Kylie Ainslie | Data Science LabThe skydiver to data scientist pipeline | Kevin Dalton | Data Science HangoutClean up your Shiny UI with popovers and tooltipsOperationalizing Agentic AI: Governance, Observability, and Human Control at ScaleTesting R code outside of WorkbenchYour VP Is Doing a Rogue Analysis in Cursor Right Now โ€” with Nell ThomasThe dessert-first approach to teaching data science | Mine Cetinkaya-Rundel | Data Science HangoutSlidecrafting - Creating beautiful slides in Quarto | 2-hr workshop | Emil HvitfeldtHow do you make decisions when data reporting is delayed? | Allie Warren | Data Science HangoutR in Institutional Research and Advancement: How Harvard, Georgetown, and UPenn Build with PositThe Bothness of It โ€” with Alex HillmanData Science Side Projects | Dylan Poulsen, Libby Heeren, Isabella Velasquez | Data Science Lab
Posit PBC |

Using R package structure for data science projects | Kylie Ainslie | Data Science Lab

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER