如何让数据框z中的1、2、3、4分别精确匹配、替换为A、B、C、D,
而不影响里面的其它数字内容?
z <- data.frame(colnames=c("1","2","3","4"),
"1"=c("1","9.98","9.99","3.33"),
"2"=c("4.44","2",'4.44',"4.44"),
"3"=c("9.99","2.22","3","9.99"),
"4"=c("4.43","2.23","2.21","4"),
check.names = F)
mgsub(z, c("1","2","3","4"),c("A","B","C","D"))