v0.4.0: Modernize package and return to CRAN#2
Merged
Merged
Conversation
CLAUDE.md is a local working file used by Claude Code in this checkout and is intentionally not tracked. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CRAN archived the package on 2024-04-20. The check NOTE that triggered
the archival was:
Invalid package aliases in Rd file 'histogram-package.Rd':
'histogramtools-package'
Per CRAN policy, the package alias must match the package name exactly
(case-sensitive). The package is HistogramTools but the Rd file
declared \name{histogramtools-package} and \alias{histogramtools-package}
in lowercase. Modern roxygen2 7.3+ generates the correct alias
automatically via the _PACKAGE sentinel; this commit makes the
hand-written Rd files match what roxygen2 would produce.
* man/histogram-package.Rd renamed to man/HistogramTools-package.Rd.
* \name and primary \alias switched to HistogramTools-package.
* Added \alias{HistogramTools} so ?HistogramTools finds this page.
* Dropped the bogus \alias{histogramtools} (not a real symbol).
* Updated all 17 \link{histogramtools-package} cross-references in
other Rd files to \link{HistogramTools-package}.
While here, also fix the second archival NOTE about Suggests/Enhances
usage by switching the three Rd-file examples that touch RProtoBuf
from `if (require(RProtoBuf))` (deprecated for conditional usage) to
`if (requireNamespace("RProtoBuf", quietly = TRUE))` per CRAN policy
3.1.4, and fully qualify P() as RProtoBuf::P() so the example body
works without attaching the namespace.
Author email in three Rd files updated to murray@stokely.org for
consistency with DESCRIPTION (which was updated in the 0.3.2 sync).
R CMD check --as-cran no longer reports the alias-mismatch NOTE.
Remaining NOTEs/WARNINGs are pre-existing (encoding, version/date,
build artifacts, RProtoBuf-not-available on macOS) and are addressed
in subsequent commits.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
DESCRIPTION refresh for the 0.4.0 release: * Bump Version 0.3.2 -> 0.4.0 and Date to today (2026-04-29). * Add `Encoding: UTF-8` so the smart-quoted Args: comments in R/ecdf.R no longer trip the "no package encoding and non-ASCII characters" CRAN check. * Replace the dead R-Forge URL with the canonical GitHub repo (https://github.com/murraystokely/histogramtools) and add a matching `BugReports:` entry. * Drop `stringr` from `Imports:` -- it was only used for one call to `stringr::str_trim` in R/dtrace.R, replaced by base R `trimws()` (equivalent behaviour for the ASCII-only DTrace xname strings being trimmed). The corresponding `importFrom(stringr, str_trim)` line in NAMESPACE is removed. .Rbuildignore additions to keep `R CMD build` output clean: * `^\.claude$` and `^CLAUDE\.md$` -- local Claude Code working state, was triggering "Found the following hidden files and directories" and "Non-standard file/directory found at top level" NOTEs. * `^\.gitignore$` and `^\.github$` -- repo metadata, not part of the package source tarball. (.github doesn't exist yet but will shortly when GitHub Actions are added.) Verified with `R CMD build .` and `R CMD check --as-cran`. The "insufficient version", "Date is over a month old", non-ASCII, and hidden-files NOTEs are all resolved. Remaining issues are the standard "new submission / was archived on CRAN" informational NOTE, RProtoBuf unavailable on this checker (Enhances:, expected), and the pre-built inst/doc/HistogramTools.pdf compaction WARNING -- the last is fixed by building with --compact-vignettes=both at submission time, and ultimately disappears once vignettes are migrated to R Markdown. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Modern R packages use a single root-level NEWS.md as the user-facing release-notes document; CRAN renders it on the package landing page, pkgdown picks it up automatically, and GitHub displays it on the repository home. The previous setup had two overlapping files: * inst/NEWS.Rd -- user-facing, but in legacy Rd format and triggering R 4.4 HTML5 validation errors during R CMD check (`<main>` not recognized) when rendered to HTML. Migrated content into NEWS.md. * ChangeLog -- developer-facing per-commit detail going back to 2013-09-13. The 204-commit git history covers the same ground at finer granularity, so this file is redundant. Deleted. NEWS.md preserves all 0.1, 0.2, 0.3, 0.3.1 entries from inst/NEWS.Rd, adds a 0.3.2 entry reflecting the 2015-07-29 CRAN release whose content was just resynced into git, and opens the 0.4.0 section. The 0.4.0 entry captures only what is committed so far on this branch; later steps in the modernization (testthat migration, GitHub Actions) will add bullets here as they land. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Travis CI's free OSS tier was discontinued in 2021 and the project's .travis.yml had been dead for years. Replace it with the canonical r-lib/actions check-standard workflow. * .github/workflows/R-CMD-check.yaml -- runs `R CMD check --as-cran` on macOS/Windows (R-release) and Ubuntu (R-devel, R-release, R-oldrel-1) on every push and pull request to master. The build invocation passes `--compact-vignettes=gs+qpdf` so the inst/doc PDF compaction WARNING is fixed in CI without requiring a separate build script. * README.md -- swap the dead travis-ci.org build badge for a GitHub Actions one pointing at the new workflow. * .travis.yml -- removed. The .github directory is excluded from the source tarball via .Rbuildignore so it doesn't appear as a non-standard top-level file in `R CMD check`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
RUnit is no longer actively developed (current CRAN page: "RUnit is
no longer actively developed") and testthat is the modern standard.
Convert the seven runit.*.R files into tests/testthat/test-*.R using
testthat's expect_*() vocabulary, register testthat as the test
harness, and drop RUnit from Suggests.
Mechanical translation:
checkEquals(actual, expected) -> expect_equal(actual, expected)
checkTrue(x) -> expect_true(x)
checkException(expr) -> expect_error(expr)
checkIdentical(a, b) -> expect_identical(a, b)
Each Test* function becomes a `test_that("...", { ... })` block, and
broader tests (TestMergeBucketsHistograms, TestSubsetHistogram) are
split into multiple focused test_that blocks. The internal
.checkMetricInvariants helper becomes expect_metric_invariants().
The conditional `if (require(emdist))` block in the EMDCC test now
uses skip_if_not_installed("emdist"), the testthat idiom.
Test data fixtures move from inst/unitTests/data/ to inst/extdata/,
the standard R convention for example/test data shipped with a
package. Two source files referenced the old path and are updated:
* vignettes/HistogramTools.Rnw (DTrace example)
* man/plot.Rd (PlotKSDCC example)
DESCRIPTION:
* `Suggests: RUnit, emdist, gdata` -> `Suggests: testthat (>= 3.0.0),
emdist, gdata`.
* Add `Config/testthat/edition: 3` to opt into stricter condition
handling (warnings are surfaced rather than silently swallowed).
Removed:
* `tests/runtests.R` -- RUnit boilerplate; replaced by tests/testthat.R.
* `inst/unitTests/` -- empty after migration; removed.
* `vignettes/HistogramTools-UnitTests.Rnw` -- a Sweave vignette that
rendered RUnit results into a PDF. testthat's reporters and CI
output cover this entirely; modern packages don't ship test
results as a vignette.
Verified with `R CMD build .` and `R CMD check --as-cran`:
* checking tests ... OK
Running 'testthat.R'
[ FAIL 0 | WARN 9 | SKIP 0 | PASS 55 ]
The 9 WARNs are pre-existing package warnings from ApproxQuantile
(documented "fewer than 100 buckets" advisory) and TrimHistogram on
all-zero input -- testthat 3e surfaces them where RUnit silently
swallowed them. Tests pass; addressing the warnings is not part of
this migration.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The R-CMD-check workflow was failing on every matrix entry with `pdflatex is not available` because the GitHub-hosted runners don't ship a LaTeX distribution by default and the package's two vignettes (HistogramTools.Rnw, HistogramTools-quickref.Rnw) are Sweave-based. Add `r-lib/actions/setup-tinytex@v2` between dependency setup and the check step. TinyTeX (https://yihui.org/tinytex/) is a small LaTeX distribution designed for CI; it auto-installs any missing LaTeX packages on demand so future preamble additions to the vignettes don't break the workflow. Adds roughly 2-3 minutes per matrix entry. The matrix runs in parallel so wall-clock impact is minimal. We are deliberately keeping Sweave .Rnw vignettes rather than migrating to R Markdown to preserve the typography of the existing PDF output. Sweave is part of base R and is not deprecated. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous TinyTeX setup commit relied on `setup-tinytex@v2`'s
auto-install hook to pull missing .sty files on demand. That hook
doesn't always engage when `Sweave` invokes `texi2dvi` directly
(rather than going through `tinytex::latexmk()`), and the run failed
on the first missing package:
! LaTeX Error: File `listings.sty' not found.
Add an explicit `tinytex::tlmgr_install()` step that installs the
packages the .Rnw preambles actually use:
- listings (source-code typesetting; the immediate culprit)
- natbib (\citep / \citet bibliography commands)
- jss (jss.cls and jss.bst -- Journal of Statistical
Software class/bibstyle used by HistogramTools.Rnw)
- hyperref (\usepackage[colorlinks]{hyperref})
- amsfonts (math fonts)
- graphics (provides graphicx.sty)
- url (URL formatting in bibliography)
For clarity: `listings` is not deprecated. It remains the standard
LaTeX package for typesetting source code and is actively maintained
on CTAN. The error is purely a CI-environment issue, not a
code-currency one.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The package's `Copyright` field was a single 2011 Google line that
hadn't been updated through any of the package's later development.
Make the joint copyright explicit and add the structured `cph` roles
that CRAN tooling (and pkgdown, citation generators, etc.) actually
read.
* Authors@R:
- Add `cph` (copyright holder) role to Murray Stokely's existing
aut/cre roles.
- Add Google, Inc. as a separate `cph`-only person entry, since
the package's original 2011 development was work-for-hire at
Google.
- Add Murray Stokely's ORCID 0009-0008-3390-1338 via the standard
`comment = c(ORCID = ...)` argument to person().
* Copyright: switch the single-line `Copyright 2011 Google, Inc.`
to a two-line statement covering Google's 2011-2015 contributions
and Murray Stokely's 2026 modernization work. Continuation-line
format per Writing R Extensions sec 1.1.1.
The conventions used here (multi-author cph in Authors@R, multi-line
Copyright, ORCID via person(comment=)) are exactly what RProtoBuf,
lubridate, and most tidyverse packages with Google ancestry use.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Surfaces the package provenance: originally developed at Google between 2011 and 2015, now independently maintained by the original author. Keeps it short, just enough context for someone arriving from the GitHub landing page or a CRAN search to understand why the copyright statement and the older inst/THANKS entries name Google. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mechanical normalization of the DESCRIPTION file via
`usethis::use_tidy_description()` (which calls `desc::desc_normalize()`
under the hood). The behaviour-relevant content is unchanged --
field values are identical, just the formatting is now in the
tidyverse-canonical layout that most modern CRAN packages use:
- Fields reordered into the canonical order (Type, Package, Title,
Version, Date, Authors@R, Maintainer, Description, License,
URL, BugReports, Imports, Suggests, Enhances, ..., Encoding).
- Authors@R reformatted with 4-space indent and one person per
line.
- Description reflowed to ~80 char lines.
- Imports/Suggests/Enhances each on their own lines, alphabetized.
One manual fix on top of the normalize: `desc_normalize()` collapsed
the two-line `Copyright:` field into a single line with a double-space
separator. Restored the explicit newline + indent so each copyright
holder is on its own line, which is what we set up two commits ago
and what is more readable for human eyes.
`R CMD check --as-cran` status unchanged (1 WARNING, 6 NOTEs --
all pre-existing as documented on the PR).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The \author{} field renders publicly on the CRAN package page and in
?function-name help output. Three Rd files (HistogramTools-package.Rd,
histogram-message.Rd, message-histogram.Rd) had this updated to
murray@stokely.org back in commit e46dcad as a side-effect of the
alias-rename work; the other 15 still pointed at the no-longer-monitored
mstokely@google.com.
This commit updates only the rendered `\email{}` inside `\author{}`.
The `% Author: mstokely@google.com (Murray Stokely)` comment lines at
the top of each Rd file (and the matching `# Author:` lines in R/*.R)
are left unchanged -- they're internal historical attribution and
not user-visible.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace the lone R-CMD-check badge with the conventional tidyverse
three-badge block wrapped in `<!-- badges: start -->`/`end` markers
(the format that `usethis::use_*_badge()` helpers maintain):
- R-CMD-check (already present, just moved into the block).
- CRAN status: shows the current CRAN version, or "deprecated" /
"archived" while the package is off CRAN. Currently informative
because the package was archived 2024-04-20; will switch to a
version number once 0.4.0 is accepted.
- Codecov test coverage: will display "unknown" until coverage
data is uploaded -- requires a separate `test-coverage.yaml`
GHA workflow and a one-time codecov.io repo enable. Not a
blocker; the badge gracefully degrades to "unknown" in the
meantime.
The Travis badge is no longer present (was already removed in
8c00786 when CI moved to GitHub Actions).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds the canonical r-lib/actions test-coverage workflow so the
Codecov badge in README.md can report numbers. Uses
covr::package_coverage() to compute coverage, covr::to_cobertura()
to format it, and codecov/codecov-action@v4 to upload.
Runs on every push and pull request to master, on Ubuntu only
(coverage doesn't need to be measured per-OS the way R-CMD-check
does -- the percentage is the same regardless of the platform).
No TinyTeX step needed because the coverage runner just exercises
the testthat suite, not the vignettes.
For the upload to actually deliver data to codecov.io, the repo
owner needs to:
1. Visit codecov.io and sign in via GitHub.
2. Enable the murraystokely/histogramtools repository.
3. (Optional) Add CODECOV_TOKEN as a repo secret. Public repos
don't strictly need it but it's recommended -- the token
scopes uploads to this repo specifically.
Until then the badge will continue to display "unknown" but the
workflow will run cleanly because `fail_ci_if_error` is false on
pull requests.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Four small smell-reducers spotted during the pre-release audit: * `vignettes/HistogramTools.pdf` (376 KB) and `vignettes/HistogramTools-quickref.pdf` (135 KB) -- stale pre-built PDFs from a 2014 `make.sh` run. R CMD build regenerates these into `inst/doc/` from the .Rnw sources, so the source-tree copies are unused and just bloat the repo. The figure `vignettes/histogram-mapreduce-diag1.pdf` is intentionally kept -- it's a referenced graphic included by the .Rnw at compile time, not a build artefact. * `.Rbuildignore`: drop the `^\.travis\.yml$` line; `.travis.yml` was deleted in 1e67d6c when CI moved to GitHub Actions, so the ignore pattern is dead. * DESCRIPTION + README: rewrite the protobuf sentence in the Description text. Two issues: - Grammar: "a protocol buffer representations of the default R histogram class" was the original wording (singular article, plural noun). Switch to "a protocol buffer representation of R's native histogram class". - Framing: "computed and manipulated in a MapReduce environment" is a 2011-era phrasing. Update to "computed and combined in distributed analytical pipelines" -- accurate in 2026 (covers Spark, Beam, Flink, and yes, MapReduce-shaped jobs) and doesn't read as if the package hasn't been touched since 2014. * README.md: modernize three http URLs: - `cran.r-project.org/web/packages/HistogramTools/index.html` -> `cran.r-project.org/package=HistogramTools` (modern URL pattern; the old one still works but is deprecated). - `r-project.org` -> https. - `google-opensource.blogspot.com` -> `opensource.googleblog.com` (the old URL still 200s but only via redirect). R CMD check --as-cran with --compact-vignettes=both: 0 ERRORs, 0 WARNINGs, 5 NOTEs (all the documented expected ones for a re-submission of an archived package). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings the package back into compliance with current CRAN policy after the 2024-04-20 archival, and modernizes the toolchain so future maintenance is easy.
The original archival was triggered by a single NOTE — an Rd file alias (
histogramtools-package) that didn't match the package name (HistogramTools) — that went unfixed because the maintainer email on file was no longer monitored. This branch fixes that and quite a bit more, in seven small commits.What changed
0c44438) — renameman/histogram-package.Rd→man/HistogramTools-package.Rd, fix\name/\aliasto match the package name, drop a bogus\alias{histogramtools}, and update 17 cross-references in other Rd files. While there, switch the three Rd-file examples that touch RProtoBuf fromif (require(RProtoBuf))toif (requireNamespace("RProtoBuf", quietly = TRUE))per CRAN policy 3.1.4, withRProtoBuf::P()fully qualified.5e554a4) — bump version to 0.4.0, set today's date, addEncoding: UTF-8, replace the dead R-Forge URL with this GitHub repo, addBugReports. DropstringrfromImports(the singlestr_trimcall is replaced by base Rtrimws())..Rbuildignoreadditions to keep dev artefacts out of the source tarball.bb603c9) — replaces bothinst/NEWS.Rd(Rd-format, triggering R 4.4 HTML5 validation errors) andChangeLog(per-commit detail superseded by the 204-commit git history). Single root-level Markdown file is the modern convention.1e67d6c) — replaces the dead.travis.yml(Travis CI killed its OSS tier in 2021) with the canonicalr-lib/actionscheck-standardworkflow: macOS/Windows on R-release, Ubuntu on R-devel/release/oldrel-1. Build flag--compact-vignettes=gs+qpdfis wired in so the inst/doc PDF compaction WARNING is fixed in CI.561fb23) — RUnit is no longer actively developed (per its own CRAN page). Convert sevenrunit.*.Rfiles intotests/testthat/test-*.R, register testthat 3 as the harness viaConfig/testthat/edition: 3, and move test fixtures frominst/unitTests/data/to the standardinst/extdata/. Drop theHistogramTools-UnitTests.RnwSweave vignette (testthat reporters and CI output cover that ground entirely).7e2cf7d) —.gitignorefor the local Claude Code working file.Test status
R CMD build .→R CMD check --as-cran HistogramTools_0.4.0.tar.gz:checking tests ... OK—[ FAIL 0 | WARN 9 | SKIP 0 | PASS 55 ]. The 9 testthat WARNs are pre-existing package warnings fromApproxQuantile(documented "<100 buckets" advisory) andTrimHistogramon all-zero input; testthat 3e surfaces them where RUnit silently swallowed them. Tests pass.--compact-vignettes=gs+qpdfso this is clean in CI; ultimately disappears when vignettes migrate to R Markdown in v0.5.RProtoBufnot available on this checker (it isEnhances:, expected), future file timestamps (offline-environment quirk), pandoc not installed locally (CRAN has it), R 4.4 HTML5 toolchain<main>warnings (not from our code), Rd cross-refs unavailable for RProtoBuf (same as v0.4.0: Modernize package and return to CRAN #2).Pending for v0.5.0 (out of scope here)
.Rnw→ R Markdown vignettes (eliminates the PDF compaction warning permanently).Test plan
R CMD build .succeeds locallyR CMD check --as-cran HistogramTools_0.4.0.tar.gzproduces the expected status (1 WARNING / 6 NOTEs above) withchecking tests ... OKR-CMD-checkworkflow runs green on this branch (will surface in the PR Checks tab once the workflow is enabled in repo settings)🤖 Generated with Claude Code