我有这个数据:
# A tibble: 169 x 5
`Topical Anesthesist` `Skin Glue` `Sedation Servi~ `Child Life Ther~ Hypnosis
<chr> <chr> <chr> <chr> <chr>
1 No, because we do not see/treat ~ No, because we do not see/tr~ No No No
2 No, we do not have one available Yes No No No
3 Yes: LET/LAT (lidocaine, epineph~ Yes Yes No No
4 Yes: LET/LAT (lidocaine, epineph~ Yes Yes No No
5 Yes: LET/LAT (lidocaine, epineph~ Yes No No No
6 Yes: LET/LAT (lidocaine, epineph~ Yes Yes No Yes: during ~
7 Yes: LET/LAT (lidocaine, epineph~ Yes Yes No Yes: during ~
8 Yes: LET/LAT (lidocaine, epineph~ Yes Yes No Yes: during ~
9 Yes: LET/LAT (lidocaine, epineph~ Yes Yes No Yes: during ~
10 Yes: LET/LAT (lidocaine, epineph~ Yes Yes No No
根据列的不同,我的值是“是”,后面是各种字符链(“是的,一整天”,“是的:全天”,等等......)。我所有的价值观都以是或否开始。我想用单词“Checked”替换以yes开头的每个值,并且用“Unchecked”替换以“No”开头的每个值(“Checked”和“Unchecked”是我在其余数据集和我的代码中使用的其他值使用它们)
我尝试:
data %>%
mutate_all(.funs = fct_recode,
"Checked" = starts_with("yes"),
"Unchecked" = starts_with("no"))
我收到此错误:
starts_with()` 必须在选择函数中使用。
我不知道如何简单地解决我的问题...
谢谢你的帮助 !