Skip to content
Prev 318585 / 398503 Next

replace zeros for NA in a column based on values of another column

Hello,

Try

# for columns a.b it's 1:2, not 1:3
data[data[,4] == 0, 1:3] <- NA  # columns a, b and c


Hope this helps,

Rui Barradas

Em 02-03-2013 10:26, Camilo Mora escreveu: