r remove na code example
Example 1: r remove na from dataset
new_df <- na.omit(df, c("myvar1", "myvar2")) # Remove NA on specific variables
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))