Questions tagged «recode»

8
根据条件语句(“ if”)替换数据框中的值
在R数据帧编码的下面,我想更换所有时代B 与出现b。 junk <- data.frame(x <- rep(LETTERS[1:4], 3), y <- letters[1:12]) colnames(junk) <- c("nm", "val") 提供: nm val 1 A a 2 B b 3 C c 4 D d 5 A e 6 B f 7 C g 8 D h 9 A i 10 B j 11 C …
122 r  recode 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.