downsample_by: Downsample an input data.frame

Description Usage Arguments Value

View source: R/scaffold.R

Description

This function downsamples an input data.frame, so that for each value of col.name, there are at most size rows.

Usage

1
downsample_by(tab, col.name, size)

Arguments

tab

Input data.frame

col.name

The name of a column in tab (typically the data in the column should either be characters or factors). For each value of tab$col.name, there will be at most size row in the output table

size

The number of rows to select for each value of tab$col.name. If size is larger than the total number of rows available for a particular value, all rows for that value will be returned

Value

Returns a data.frame


ParkerICI/scgraphs documentation built on April 30, 2021, 1:10 p.m.