Learn R Programming

Tplyr (version 1.2.1)

get_by: Set or return by layer binding

Description

Set or return by layer binding

Usage

get_by(layer)

set_by(layer, by)

Value

For get_by, the by binding of the supplied layer. For

set_by the modified layer environment.

Arguments

layer

A tplyr_layer object

by

A string, a variable name, or a list of variable names supplied using dplyr::vars.

Examples

Run this code
# Load in pipe
library(magrittr)
iris$Species2 <- iris$Species
lay <- tplyr_table(iris, Species) %>%
  group_count(Species) %>%
  set_by(vars(Species2, Sepal.Width))

Run the code above in your browser using DataLab