vincentarelbundock / tinytable

Simple and Customizable Tables in `R`
https://vincentarelbundock.github.io/tinytable
GNU General Public License v3.0
210 stars 18 forks source link

`tt()` passing custom column names #384

Closed kylebutts closed 6 hours ago

kylebutts commented 6 hours ago

Hi Vincent,

A pain point I am finding is that I have to write custom column names for my df object before piping to tt. Would it be hard to accept an argument to tt to provide custom column names?

vincentarelbundock commented 6 hours ago

You can use setNames() from base R in a pipe. Or standard colnames(tab)<- otherwise.

See bottom page https://vincentarelbundock.github.io/tinytable/vignettes/tinytable.html#renaming-columns

Doesn't that cover most workflows?

kylebutts commented 6 hours ago

This definitely suffices! Somehow I did not know of base::setNames() (I probably thought of it as a data.table function)

vincentarelbundock commented 4 hours ago

Cool.

Yeah, that's confusing because data.table has setnames() --- lower case.