Closed kylebaron closed 2 years ago
I love that this function can rename column names but I was wondering if we could have it do a little more... this maybe out-of-scope at the moment so happy to move this to a separate issue if it's too much.
Sometimes I'll do a pivot_long on the table so my covariates are all in a "name" column (e.g. then I can facet on covariate name) - it would be nice to be able to rename the contents of a specific column in the same way you're renaming column headings here. I guess I could rename the columns before doing the pivot but then I'd have to use the "short" name (with spaces) to tell it which columns to pivot and that could get ugly - it would also stop me pivoting on a covariate flag.
I can share some code of what I've been doing on projects if you think it would be within the scope of this function
ys_recode()
to convert a vector of column names into short name plus or minus the unit based on ayspec
objectys_rename()
generic; method foryspec
which operates as previous; new method fordata.frame()
that lets the user rename columns based on short or short+unit in the spec.