To filter out a row that contains NA in a specific column in R, you can use the !is.na() function within the dplyr package or base R. Here's how you can do it:
main.r426 chars21 lines
In this code:
df[!is.na(df$name), ] uses base R to select all rows where the 'name' column is not NA.df %>% filter(!is.na(name)) uses the dplyr package to achieve the same result.Both methods will produce the same output, which is a data frame with the rows containing NA in the 'name' column filtered out.
gistlibby LogSnag