Skip to contents

This function takes a data.table and converts the first letter of all column names to lowercase.

Usage

setHeadersToLowerCase(dt)

Arguments

dt

A data.table object whose column names need to be converted to lowercase.

Value

The modified data.table with updated column names.

See also

Other function to read from and write to xlsx: splitInputs(), xlsxAddDataUsingTemplate(), xlsxAddSheet(), xlsxCloneAndSet(), xlsxReadData(), xlsxWriteData()

Examples

dt <- data.table::data.table(FirstName = c("John", "Jane"), LastName = c("Doe", "Smith"))
dtLower <- setHeadersToLowerCase(dt)
print(names(dtLower)) # Result: c("firstname", "lastname")
#> [1] "firstName" "lastName"