group_by_level: group by level

group_by_levelR Documentation

group by level

Description

group by level

Usage

group_by_level(x, ...)

## S3 method for class 'character'
group_by_level(x, ...)

## S3 method for class 'factor'
group_by_level(x, ...)

## S3 method for class 'data.table'
group_by_level(x, var, idvar, ...)

Arguments

x

named logical/character/factor

...

S3 dispatch

var

string

idvar

string

Value

unnamed character

Examples

t1 <- c( KLF5 = 'up',  F11 = 'up', RIG = 'flat',   ABT1 = 'down')
dt <- data.table( gene = c( 'KL5', 'F11', 'RIG',  'ABT1' ), 
                    t1 = c( 'up',  'up',  'flat', 'down' ) )
group_by_level(t1)                #  character
group_by_level(factor(t1))        #     factor
group_by_level(dt, 't1', 'gene')  # data.table

bhagwataditya/autonomics documentation built on Nov. 1, 2024, 5:47 a.m.