You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now that I'm getting used to zeallot, I find myself wishing I could use it in mutate.
A motivating example based on within. It would be nice if something similar could work within mutate.
library(purrr)
library(zeallot)
library(tibble)
# dummy data
(df<- tibble(id= paste0(sample(c("M", "F"), 6, T), ".", sample(20:50, 6, T) )))
#> # A tibble: 6 x 1#> id #> <chr>#> 1 M.34 #> 2 F.32 #> 3 M.41 #> 4 F.26 #> 5 F.27 #> 6 M.21
within(df, c(sex, age) %<-% simplify_all(transpose(strsplit(id, ".", fixed=TRUE))))
#> # A tibble: 6 x 3#> id age sex #> <chr> <chr> <chr>#> 1 M.34 34 M #> 2 F.32 32 F #> 3 M.41 41 M #> 4 F.26 26 F #> 5 F.27 27 F #> 6 M.21 21 M
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/
lockbot
locked and limited conversation to collaborators
Oct 8, 2018
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Now that I'm getting used to zeallot, I find myself wishing I could use it in
mutate
.A motivating example based on
within
. It would be nice if something similar could work withinmutate
.Created on 2018-02-22 by the reprex package (v0.2.0).
The text was updated successfully, but these errors were encountered: