checktor

projects
Published

July 3, 2026

checktor hex logo: a stethoscope whose chestpiece is a green check mark

checktor hex logo: a stethoscope whose chestpiece is a green check mark

Project Details

Project Title: A Package Doctor for CRAN Submission Checks (checktor)

Project URL: https://cran.r-project.org/package=checktor

Documentation: https://r-pkg.thecoatlessprofessor.com/checktor/

Code Repository: https://github.com/coatless-rpkg/checktor

Project Version: 0.1.0

Project Status: Active

Project Description: checktor runs the extra-CRAN diagnostic checks that stand between a clean R CMD check and a clean CRAN submission. These are the requirements CRAN reviewers enforce by hand but the standard tooling never flags: T/F used in place of TRUE/FALSE, hardcoded set.seed() calls, a Description field that opens with “This package”, a missing \value{} tag, a tarball past the size limit, an http:// URL that should be https://. None of these stop R CMD check, yet any of them can stop a submission. checktor gathers that scattered folklore into a single function you can run before you hit submit. It leans into a medical metaphor: you run a checktor() examination, read the diagnosis, ask for a prescribe()-d set of treatments, and generate a health_report() to keep on file, with a boolean checkup() wrapper for continuous integration. Every code-side diagnostic parses your R/ sources into an abstract syntax tree and runs XPath queries against it, so a pattern written inside a string or a comment is never mistaken for real code. checktor is meant to sit alongside R CMD check and lintr, not to replace either one.

Installation

Install the released version from CRAN:

install.packages("checktor")

Or the development version from GitHub:

# install.packages("pak")
pak::pak("coatless-rpkg/checktor")

Usage

library(checktor)

# Examine the package in the current working directory
results <- checktor()

# Turn each finding into a concrete remedy
prescribe(results)

# Write a report to keep alongside cran-comments.md
cat(health_report(results, format = "markdown"), sep = "\n")

# Collapse the diagnosis to TRUE / FALSE for CI
if (!checkup()) stop("checktor found issues")

Motivation

R CMD check verifies that a package is technically sound, but it does not enforce the conventions a CRAN reviewer applies by hand. Those live in the CRAN Repository Policy, in the CRAN Cookbook (a self-service guide to solutions for common CRAN submission issues), and in community lists such as Davis Vaughan’s extrachecks, a running collection of “extra ad-hoc checks that CRAN does that are not checked for by devtools::check().”

Release helpers turn that knowledge into a checklist you work through by hand: devtools::submit_cran() uploads a build, and usethis::use_release_issue() opens a GitHub issue full of manual to-do items. checktor takes the complementary route. It encodes those extended checks as deterministic diagnostics you can run on demand, gate a CI build on, and re-run on every commit, so the catalog is enforced by code rather than from memory.

Features

checktor 0.1.0

  • Added checktor() as the top-level orchestrator, running five categories of diagnostics (code, DESCRIPTION, documentation, general, CRAN policy) against an R package directory.
  • Added the checkup() boolean wrapper for CI use, prescribe() for treatment recommendations, and health_report() for Markdown / HTML / text reports.
  • All code-side diagnostics run XPath queries against the parsed abstract syntax tree via xmlparsedata and xml2. Documentation-side checks walk .Rd files via tools::parse_Rd(). The DESCRIPTION file is parsed with base::read.dcf().

References

Every external link used on this page, gathered in one place (the project’s own CRAN, documentation, and repository links are in Project Details above):