Summary Statistics for Histogram/Count Data
Overview
In some cases you will have data in a histogram format, where you have a vector of all possible observations, and a vector of how many times each observation appeared. You could expand this into a single 1D vector, but this may not be advisable if the counts are extremely large. 'HistDat' allows for the calculation of summary statistics without the need for expanding your data.
Added
- Implemented the
[operator for HistDat instances, allowing you to find the value at the ith position if the observations were flattened into a 1-D vector. - Implemented the
sortoperator as a no-op, for compatibility with R base functions. - Implemented the
cfunction, allowing you to concatenate new observations into aHistDatinstance. This also allowsHistDatinstances to interoperate with other R base functions. - Added S3 implementations for
mean,medianandsort, which are S3 generic methods that aren't S4 aware, meaning that you can only implement them using S3 methods. This also allows for better integration with R internals.
Changed
- Previously the
quantile()method actually flattened the entire observation vector which crashed R in situations with high counts. This is now fixed. - Ensure that the vals vector is sorted upon calling
HistDat::HistDat().
From NEWS.md in the release
Install
Health
NOTECRAN incoming feasibilityr-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc
Maintainer: ‘Michael Milton <michael.r.milton@gmail.com>’
No Authors@R field in DESCRIPTION.
Please add one, modifying
Authors@R: person(given = "Michael",
family = "Milton",
role = c("aut", "cre"),
email = "michael.r.milton@gmail.com")
as necessary.- NOTE11 OK, 2 NOTENow
- NOTE12 OK, 2 NOTE2026-03-10
Documentation
- Help pages
- 19includes a package overview page
- Examples that run
- 100%17 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 50%
- Help pages citing references
- 0%
- histdat HTML
Downloads
Dependencies
Installing HistDat adds no packages beyond those that come with R.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- 0.2.0Latest
- 0.1.02021-04-02
- RR 4.0.0 released · 2020-04-24
Package metadata
- First published
- 2021-04-02
- Total releases
- 2 / 5 yrs
- License
- GPL (>= 3) OSI
- Download size
- 14 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("HistDat")Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.