colNames {strvalidator} | R Documentation |
Column Names
Description
Internal helper function.
Usage
colNames(data, slim = TRUE, concatenate = NULL, numbered = TRUE, debug = FALSE)
Arguments
data |
data.frame. |
slim |
logical, TRUE returns column names occurring once, FALSE returns column names occurring multiple times. |
concatenate |
string, if not NULL returns a single string with column names concatenated by the provided string instead of a vector. |
numbered |
logical indicating if repeated column names must have a number suffix. |
debug |
logical indicating printing debug information. |
Details
Takes a data frame as input and return either column names
occurring once or multiple times. Matching is done by the 'base name'
(the substring to the left of the last period, if any). The return type
is a string vector by default, or a single string of column names separated
by a string 'concatenate' (see 'collapse' in paste
for details).
There is an option to limit multiple names to those with a number suffix.
Value
character, vector or string.