-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Description
Here's a reprex:
library(labelled)
library(glue)
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
test = tibble(
a = 1 |> set_label_attribute("a1"),
b = glue::glue("two") |> set_label_attribute("b2")
)
test$b |> get_label_attribute()
#> [1] "b2"
# filter() strips the variable label from column `b`
dplyr::filter(test)$b |> get_label_attribute()
#> NULL
# filter() doesn't strip the label from column `a`
dplyr::filter(test)$a |> get_label_attribute()
#> [1] "a1"Created on 2025-01-28 with reprex v2.1.1
I expected column b to keep its label attribute. Not sure if this is ultimately an issue with dplyr, glue, or labelled, but seems like it's in dplyr?
Metadata
Metadata
Assignees
Labels
No labels