Learn R Programming

Tplyr (version 1.2.1)

get_where.tplyr_layer: Set or return where binding for layer or table

Description

Set or return where binding for layer or table

Usage

# S3 method for tplyr_layer
get_where(obj)

# S3 method for tplyr_layer set_where(obj, where)

get_where(obj)

# S3 method for tplyr_table get_where(obj)

set_where(obj, where)

# S3 method for tplyr_table set_where(obj, where)

set_pop_where(obj, where)

get_pop_where(obj)

Value

For where, the where binding of the supplied object. For set_where, the modified object

Arguments

obj

A tplyr_layer or tplyr_table object.

where

An expression (i.e. syntax) to be used to subset the data. Supply as programming logic (i.e. x < 5 & y == 10)

Examples

Run this code
# Load in pipe
library(magrittr)

iris$Species2 <- iris$Species
lay <- tplyr_table(iris, Species) %>%
  group_count(Species) %>%
  set_where(Petal.Length > 3) %>%
  # Set logic for pop_data as well
  set_pop_where(Petal.Length > 3)

Run the code above in your browser using DataLab