Convert Data Table Column Names to Lowercase
setHeadersToLowerCase.RdThis function takes a data.table and converts the first letter of all column names to lowercase.
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"