Created
December 3, 2017 18:11
-
-
Save joranE/324f7d486f407cea499e54b3c032541a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dat <- structure(list(rank = c("1 ", "1 ", "1 "), bib = c("1 ", "1 ", | |
"1 "), `fis code` = c("3422819 ", "3422819 ", "3422819 "), name = c("KLAEBO Johannes Hoesflot ", | |
"KLAEBO Johannes Hoesflot ", "KLAEBO Johannes Hoesflot "), nsa = c("NOR ", | |
"NOR ", "NOR "), `7.35km` = c("3 ", "18:30.8 ", "10 "), `11.1km` = c("18 ", | |
"28:39.5 ", ""), `22.3 km` = c("2 ", "57:36.8 ", "12 "), `26.1km` = c("7", | |
"1:07:08.1 ", "4"), finish = c("1:16:47.1 ", "1:16:47.1 ", "1:16:47.1 " | |
), fis = c("0.00", "0.00", "0.00"), grp = c(1L, 1L, 1L), val = c("split_rank", | |
"split_time", "split_bonus")), .Names = c("rank", "bib", "fis code", | |
"name", "nsa", "7.35km", "11.1km", "22.3 km", "26.1km", "finish", | |
"fis", "grp", "val"), row.names = c(NA, -3L), class = c("grouped_df", | |
"tbl_df", "tbl", "data.frame"), vars = "grp", drop = TRUE, indices = list( | |
0:2), group_sizes = 3L, biggest_group_size = 3L, labels = structure(list( | |
grp = 1L), row.names = c(NA, -1L), class = "data.frame", vars = "grp", drop = TRUE, .Names = "grp")) | |
library(dplyr) | |
dat %>% | |
rename_at(.vars = vars(contains("nsa")),.funs = function(x) "nation") | |
# Error: All arguments must be named |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
your function isn't named. Try defining
and then funs=f inside rename_at.