📜  r 根据条件更改列 - R 编程语言代码示例

📅  最后修改于: 2022-03-11 14:52:00.043000             🧑  作者: Mango

代码示例1
# If a condition is met in a specific column (column "b" is 0), 
# change the value in column "est". Here the value is replaced
# by the value for "a" in that same row where b == 0.

df$est[df$b == 0] <- df$a[df$b == 0]