Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Making an R Package

Making an R Package

Avatar for Nicholas Williams

Nicholas Williams

April 01, 2019

Other Decks in Technology

Transcript

  1. Who am I? - Nick Williams - 2nd year MPH

    Candidate, Biostatistics Department - Have been working in R for real work and as a hobby for about 5-years
  2. How I got into making a package - Integrating R

    into the curriculum for Analysis of Categorical Data (P8120) - Many of the R functions for basic categorical data analysis were outdated, spread across multiple packages, not beginner friendly, and followed different syntax - My goal: Consolidate and repurpose existing functions into one package with a unified structure - The result was catfun (categorical functions, categorical is fun, cats are fun)
  3. Who can/should make a package? Anyone with: - With a

    solution to a problem that others likely also have - The technical know-how - A healthy dose of curiosity - So you
  4. Basic package structure At a minimum, your package should contain

    at least 3 items: - R/ - DESCRIPTION - NAMESPACE If you want to publish on CRAN - tests/ - man/
  5. What you need to consider - Your audience - Your

    goals - OOP (maybe) - Memory/speed (Rcpp) - The time to keep it functional For a comprehensive walk through: - R packages by Hadley Wickham