pct.below: Number or percent of rows (for each col) where value is below...

View source: R/pct.below.R

pct.belowR Documentation

Number or percent of rows (for each col) where value is below cutoff(s)

Description

Count the number or percent of rows (for each col of a data.frame) where the value is below some specified cutoff(s)

Usage

pct.below(
  df,
  benchmarks = "mean",
  benchnames = "cutoff",
  na.rm = FALSE,
  or.tied = FALSE,
  below = TRUE,
  wts = 1,
  of.what = "all"
)

Arguments

df

Data.frame or matrix, required.

benchmarks

Default is 'mean' but otherwise this must be a number or numeric vector of thresholds to compare values to.

benchnames

Default is 'cutoff' and this string is used to create colnames for the results

na.rm

Logical value, optional, TRUE by default. Defines whether NA values should be removed first. Otherwise result will be NA when any NA is in a col.

or.tied

Logical, FALSE by default, reporting on those < cutoff. But, if or.tied=TRUE, this reports on those <= cutoff.

below

Logical, TRUE by default, which counts how many are below cutoff (or tied if or.tied). If FALSE, counts how many are above (or tied with) cutoff.

wts

Number or vector, default is 1. Length must be a factor of number of rows in df, so length(df[,1]) is an integer multiple of length(wts) Applies weights to when counting how many.

of.what

Optional, character, 'all' by default, defines xxx as the text used in "pct.above.xxx" (or below) for fieldnames in results

Details

See pct.above() for details, for which this is a wrapper.

Value

Returns a vector of numbers of length equal to number of columns in df.

See Also

count.above() pct.above() pct.below() to see, for each column, the count or percent of rows that have values above or below a cutoff.

cols.above.count() cols.above.which() cols.above.pct() to see, for each row, the count or which or fraction of columns with numbers at/above/below cutoff.

colcounter_summary() colcounter_summary_cum() colcounter_summary_pct() colcounter_summary_cum_pct() tablefixed()


ejanalysis/analyze.stuff documentation built on April 2, 2024, 10:10 a.m.