split_tibble: Parse/split a tibble into a list according to one column....

Description Usage Arguments Value Examples

View source: R/split_tibble.R

Description

Parse/split a tibble into a list according to one column. Ideally one column has categorical variable thus can be eatracted, each level would become a new element name of the list.

Usage

1
split_tibble(tibble, column, keep)

Arguments

tibble

a tibble object that has at least two columns.

column

String. The column used as index, preferably contains categorical variable.

keep

String. The single or multiple column names to keep.

Value

A list. The selected column with preferably differetn levels would be used as index and the rest or selected columns would be kept. The tibble would become a list.

Examples

1
2
df = tibble(A = c(1:5),B = c(rep('M',3),rep('T',2)))
split_tibble(df,'B','A')

liulihe954/EnrichKit documentation built on Oct. 10, 2020, 11:49 p.m.