Learn R Programming

gggenomes (version 1.0.1)

split_by: Split by key preserving order

Description

Split by key column while preserving order according to the first occurence. R base split converts keys to factors, changing default order to alphanumeric.

Usage

split_by(.data, key)

Value

a list of tibbles

Arguments

key

variable to split by

Examples

Run this code
tibble::tibble(x = c(1, 1, 1, 2), y = c("B", "A", "B", "B"), z = "foo") %>%
  split_by(x)

Run the code above in your browser using DataLab