View source: R/rm.empty.cols.R
rm.empty.cols | R Documentation |
rm.empty.cols
removes columns that have only NAs
AND whose names
start with a capital 'X' (unless na.only is TRUE
in which case all NA
columns
will be removed).
rm.empty.cols(x, na.only = FALSE)
x |
( |
na.only |
( |
Empty columns in Excel sheets are imported to NA
columns in the resulting data frame.
If using gdata::read.xls
for reading Excel files, columns that did not have a column name in the
spread sheet will result in data frame column names starting with 'X'. rm.empty.cols
makes use
of these two criteria to identify columns that can safely be removed from the data frame.
A data frame.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.