rmNARow | R Documentation |
Remove all rows that have an NA in at least one of the specified columns.
rmNARow(data_dt, cols_v = NULL, extract_v = F)
data_dt |
data.table or data.frame to have rows removed |
cols_v |
columns to check for NA in. If NULL (default) will check all columns |
extract_v |
logical, TRUE - output the NA rows; FALSE (default) - output the input table with NA rows removed |
data.table either containing the offending rows (extract_v == T), or the input table with those rows removed
data_df <- data.frame("A" = 1:5, "B" = c(1,2,NA,4,5), "C" = c(NA,2:5), "D" = c(1:4,NA))
rmNARow(data_dt = data_df, cols_v = "A")
rmNARow(data_dt = data_df, cols_v = c("A", "B"))
rmNARow(data_dt = data_df)
rmNARow(data_dt = data_df, extract_v = T)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.