vlookup函数在excel是超级实用,而在R语言下有epiDisplay包lookup来实现: 123456 library(epiDisplay)a <- c( 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, NA)tx <- rbind(c(1,2),c(2,1),c(3,4),c(4,NA),c(NA,3)) new.a <- lookup(a, tx) 将a数据集,被tx替换 赞微海报分享
近期评论