• R/O
  • SSH

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修订版4055c222ba54944d84fb2e1ad56e47fceb426041 (tree)
时间2022-04-21 04:21:27
作者Lorenzo Isella <lorenzo.isella@gmai...>
CommiterLorenzo Isella

Log Message

I added a function to recode many values at the same time.

更改概述

差异

diff -r c8060613283d -r 4055c222ba54 R-codes/stat_lib.R
--- a/R-codes/stat_lib.R Sun Apr 10 00:35:42 2022 +0200
+++ b/R-codes/stat_lib.R Wed Apr 20 21:21:27 2022 +0200
@@ -6447,3 +6447,16 @@
64476447 return(links)
64486448 }
64496449
6450+
6451+
6452+## See discussion at https://github.com/tidyverse/dplyr/issues/3218
6453+
6454+
6455+recode_many <- function(x, old_names, new_names){
6456+
6457+ name_lookup <- set_names(new_names, old_names) %>% as.list
6458+
6459+ res <- recode(x, !!!name_lookup)
6460+ return(res)
6461+
6462+}