0Pricing
R Academy · Lesson

CRAN Submission and Package Maintenance

Run R CMD check, resolve NOTE/WARNING issues, and submit to CRAN.

The CRAN Submission Process

CRAN (Comprehensive R Archive Network) is the official R package repository. Submitting a package requires passing automated checks and human review against strict policies. The process: prepare → check → build → submit → revise based on feedback.

devtools::check() — Zero Errors and Warnings

Before submission, devtools::check() must produce 0 ERRORs and 0 WARNINGs. NOTEs are allowed but should be minimized. Common issues caught by check:

  • Undocumented functions or arguments
  • Missing package imports in DESCRIPTION
  • Examples that error or take too long
  • Global variable usage (use utils::globalVariables())
# devtools::check()  # or Ctrl+Shift+E
#
# Target output:
# -- R CMD check results -------------------------
# Duration: 45.3s
# 0 errors v | 0 warnings v | 1 note x
# NOTE: New submission.
#
# 'New submission' is an expected NOTE for first-time packages.
# All actual ERRORs and WARNINGs must be fixed before submitting.

All lessons in this course

  1. Package Structure with usethis and devtools
  2. Documenting Functions with roxygen2
  3. Unit Testing with testthat
  4. CRAN Submission and Package Maintenance
← Back to R Academy