rm.empty.cols: Remove Empty Columns From an Imported Excel Sheet

Description Usage Arguments Details Value

View source: R/rm.empty.cols.R

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

1
rm.empty.cols(x, na.only = FALSE)

Arguments

x

(data.frame). A data frame resulting from an imported Excel sheet by means of read.xls

na.only

(logical). Should all 'NA' columns be removed and not only those with a column name starting with X as generated by Excel (see details section)?

Details

Empty columns in Excel sheets are imported to NA columns in the resulting data frame. 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.


readmoRe documentation built on Aug. 19, 2021, 9:07 a.m.