replace(text, text %in% c("leg", "foot"), "LEG"). [1] "arm" "LEG" "head" "LEG" "hand" "hindleg" "elbow". > x <- c(3, 2, 1, 0, 4, 0). > replace(x, x==0, 1).
確定! 回上一頁