subset.validlevels: Subset a data.frame by group y where each level has to be...

View source: R/helpers.R

subset.validlevelsR Documentation

Subset a data.frame by group y where each level has to be larger than size x

Description

Subset a data.frame by group y where each level has to be larger than size x

Usage

## S3 method for class 'validlevels'
subset(x, group, mincounts)

Arguments

x

data.frame: The data.frame to subset

group

character vector: the columnname of the data frame to build groups from

mincounts

numeric vector: the minimal size allowed for a group zo stay in the dataframe

Value

dataframe

Author(s)

Stefan Bartels, email@biobits.eu

Examples

ID1<-c(2,3,45,343,34,8,77,88,90)
ID2<-c("A","A","B","C","C","C","D","D","D")
df<-data.frame(ID1,ID2)
df<-subset.validlevels(df,"ID2",3)


biobits/bbhelper documentation built on Feb. 11, 2025, 4:53 p.m.