Skip to content

slice() does not give additional context about group etc ... #5931

@romainfrancois

Description

@romainfrancois

... the same way filter() etc ... give:

library(dplyr, warn.conflicts = FALSE)
df <- data.frame(x = 1:10, g = rep(1:2, each = 5)) %>% group_by(g)

filter(df, "a")
#> Error: Problem with `filter()` input `..1`.
#> ℹ Input `..1` is `"a"`.
#> x Input `..1` must be a logical vector, not a character.
#> ℹ The error occurred in group 1: g = 1.
slice(df, "a")
#> Error: `slice()` expressions should return indices (positive or negative integers).

Created on 2021-06-28 by the reprex package (v2.0.0)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions