Skip to content

Commit

Permalink
Update compat-dplyr
Browse files Browse the repository at this point in the history
  • Loading branch information
chartgerink committed Feb 4, 2025
1 parent 75f050f commit 2de133c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions vignettes/compat-dplyr.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ x %>%
`dplyr::pull()` returns a vector, which maintains the tag but result in loss of the safeframe class:

```{r}
x <- make_safeframe(
cars,
mph = "speed",
distance = "dist"
)
x %>%
pull(speed)
```
Expand Down Expand Up @@ -149,6 +155,11 @@ x %>%
`dplyr::select()` is fully compatible with safeframe, including when columns are renamed in a `select()`:

```{r}
x <- make_safeframe(
cars,
mph = "speed",
distance = "dist"
)
# Works fine
x %>%
select(speed, dist) %>%
Expand Down Expand Up @@ -182,6 +193,11 @@ dim(bind_rows(x, x))
- Warnings are produced about lost tags, even for tags that are not actually lost

```{r}
x <- make_safeframe(
cars,
mph = "speed",
distance = "dist"
)
bind_cols(
suppressWarnings(select(x, speed)),
suppressWarnings(select(x, dist))
Expand Down

0 comments on commit 2de133c

Please sign in to comment.