Learn R Programming

strvalidator (version 1.3.0)

colNames: colNames

Description

colNames is an internal helper function.

Usage

colNames(df, slim = TRUE, concatenate = NULL, debug = FALSE)

Arguments

df
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.
debug
logical indicating printing debug information.

Value

  • character, vector or string.

Details

colNames 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).