rm.empty.cols {readmoRe} | R Documentation |
Remove Empty Columns From an Imported Excel Sheet
Description
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).
Usage
rm.empty.cols(x, na.only = FALSE)
Arguments
x |
( |
na.only |
( |
Details
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.
Value
A data frame.