r - remove NA code example
Example 1: r - remove na
# remove na in r
newdf <- na.omit(df)
Example 2: r - remove NA from a coulm
df <- data.frame(x = c(1, 2, 3), y = c(0, 10, NA), z=c(NA, 33, 22))
subset(df, !is.na(y))
# remove na in r
newdf <- na.omit(df)
df <- data.frame(x = c(1, 2, 3), y = c(0, 10, NA), z=c(NA, 33, 22))
subset(df, !is.na(y))