View source: R/remove_all_NA_rowcols.R
remove_all_NA_rowcols | R Documentation |
Trim any rows and/or columns containing all NAs from a matrix or data frame. Any rows or columns composed entirely of NAs are removed.This is used primarily after reading in a spreadsheet, when excess columns and/or rows may be included due to quirks in the file reading process. It can also remove cases and/or variables with no data.
remove_all_NA_rowcols(
x, cols = TRUE, rows = TRUE, interpret_text = TRUE)
x |
data frame or matrix with rows and/or columns to be removed |
cols , rows |
logical, whether to trim columns and rows, respectively. By default, both columns and rows are trimmed. |
interpret_text |
whether to convert text "NA" to NA values. Default behavior is to set values that are read as "NA" to NA before filtering. |
an object of the same type as x
, potentially with fewer rows and/or columns
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.