Skip to content

Scaling with Ranked Subsampling

2packages dependsuggested by 1
5Kdownloads / year
–test coverage
11/13flavors OK

Overview

About

Analysis of species count data in ecology often requires normalization to an identical sample size. Rarefying (random subsampling without replacement), which is a popular method for normalization, has been widely criticized for its poor reproducibility and potential distortion of the community structure. In the context of microbiome count data, researchers explicitly advised against the use of rarefying. An alternative to rarefying is scaling with ranked subsampling (SRS). SRS consists of two steps. In the first step, the total counts for all OTUs (operational taxonomic units) or species in each sample are divided by a scaling factor chosen in such a way that the sum of the scaled counts Cscaled equals Cmin. In the second step, the non-integer Cscaled values are converted into integers by an algorithm that we dub ranked subsampling. The Cscaled value for each OTU or species is split into the integer part Cint (Cint = floor(Cscaled)) and the fractional part Cfrac (Cfrac = Cscaled - Cints). Since the sum of Cint is smaller or equal to Cmin, additional delta C = Cmin - the sum of Cint counts have to be added to the library to reach the total count of Cmin. This is achieved as follows. OTUs are ranked in the descending order of their Cfrac values. Beginning with the OTU of the highest rank, single count per OTU is added to the normalized library until the total number of added counts reaches delta C and the sum of all counts in the normalized library equals Cmin. When the lowest Cfrag involved in picking delta C counts is shared by several OTUs, the OTUs used for adding a single count to the library are selected in the order of their Cint values. This selection minimizes the effect of normalization on the relative frequencies of OTUs. OTUs with identical Cfrag as well as Cint are sampled randomly without replacement. See Beule & Karlovsky (2020) doi:10.7717/peerj.9593 for details.

Install

Health

CRAN checks
2NOTE11OK
Check messages
NOTECRAN incoming feasibilityr-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc
Maintainer: ‘Lukas Beule <lukas.beule@julius-kuehn.de>’

Package CITATION file contains call(s) to old-style personList() or
as.personList().  Please use c() on person objects instead.
Package CITATION file contains call(s) to old-style citEntry().  Please
use bibentry() instead.

CRAN check page ↗

Slowest check: 1.9 min · r-oldrel-windows-x86_64
Status changes
  • NOTE11 OK, 2 NOTE2026-09-08
  • ERROR10 OK, 2 NOTE, 1 ERROR2026-09-07
  • NOTE12 OK, 2 NOTE2026-03-10
Advisories

none known

Documentation

In release 0.2.3
READMENoVignettesNoNEWSNoCitation fileYes · cites a publicationWebsitenot declared in DESCRIPTION
Help pages
3
Examples that run
100%3 run in a plain check
Exported functions with examples
100%
Documented parameters
not tracked
Return-value docs
not tracked
Help pages citing references
100%

Downloads

5K
CRAN downloads in the past year
Rank #7,308 · ~14/day · ~420/mo
Daily download trend is not available in this view yet.
47730 days
1.2K90 days
5K1 year
Compare downloads with other packages →
Also on163 r2u2 autocran678 conda_forge

Dependencies

Declared dependencies
5 external dependencies (excludes base and recommended)

Installing SRS adds 45 packages (23 with compiled code, 35 MB of source tarballs). Heaviest: bslib 5.6 MB, promises 3.1 MB, sass 2.9 MB.

Imports (0)
none
LinkingTo (0)
none
Suggests (0)
none
Enhances (0)
none
Reverse dependencies
2direct
0indirect
Imports 2
Suggested by 1
Depends, Imports or LinkingTo, most downloaded first
Suggests, most downloaded first

People & History

People (3)
Author, Maintainer since 0.1.0 (2020)
Author · added in 0.1.1
Listed in earlier versions (1)
Devon O'rourke
no longer listed · 0.1.2 to 0.2.2
Releases (7)

Pick two releases to compare their code metrics.

  • R
    R 4.6.0 released · 2026-04-24
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • R
    R 4.3.0 released · 2023-04-21
  • R
    R 4.2.0 released · 2022-04-22
  • 0.2.3Latest
    record
    2022-03-27 · current release · diff ↗
  • R
    R 4.1.0 released · 2021-05-18
  • 0.2.2
    record
    2021-02-10 · diff ↗
  • 0.2.1
    record
    2020-11-17 · diff ↗
  • 0.2.0
    record
    2020-11-14 · diff ↗
  • 0.1.2
    record
    2020-10-29 · diff ↗
  • 0.1.1
    record
    2020-10-02 · diff ↗
  • 0.1.0
    record
    2020-08-31
  • R
    R 4.0.0 released · 2020-04-24

Package metadata

First published
2020-08-31
Total releases
7 / 6 yrs
License
CC BY-SA 4.0
Minimum R
≥ 3.4.0
Download size
11 KB

Cite

Cite this package

Run in R for the authors' entry:

citation("SRS")

The package provides a citation file, so citation() returns the authors' own entry.

It points to 10.7717/peerj.9593, 10.3390/app112311473.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for SRS version 0.2.3 [Data set]. HJJB, LLC. Data release v2026-10-24. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-24, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy