-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in across.()
when used in map.()
#505
Labels
bug
Something isn't working
Comments
Seemingly, this is because of the formula function error. Normal function works as expected. tibble::tribble(
~id, ~data,
1, data.frame(x = runif(5))
) |>
tidytable::mutate.(
data = tidytable::map.(
data,
\(x) {
tidytable::mutate.(
x,
tidytable::across.(
.fns = as.character
)
)
}
)
) |>
purrr::pluck("data", 1)
#> # A tidytable: 5 × 1
#> x
#> <chr>
#> 1 0.267508938442916
#> 2 0.441175762796775
#> 3 0.356469556922093
#> 4 0.83364535542205
#> 5 0.774993801722303 Created on 2022-06-19 by the reprex package (v2.0.1) |
Thanks for catching this - I'll take a look and see what I can figure out. |
All set. set.seed(123)
library(tidytable, warn.conflicts = FALSE)
df <- tidytable(id = 1, data = list(data.frame(x = round(runif(5), 4))))
df %>%
mutate.(
data = data %>%
map.(
~ . |>
mutate.(
across.(.fns = as.character)
)
)
) %>%
purrr::pluck("data", 1)
#> # A tidytable: 5 × 1
#> x
#> <chr>
#> 1 0.2876
#> 2 0.7883
#> 3 0.409
#> 4 0.883
#> 5 0.9405 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See the difference between {tidytable} and {tidyverse}. Seemingly the expression is quoted and not evaluated when used in
map.()
.Created on 2022-06-19 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: