metrumresearchgroup / yspec

Data Specification for Pharmacometrics
https://metrumresearchgroup.github.io/yspec
5 stars 2 forks source link

Feature: recode / rename #114

Closed kylebaron closed 2 years ago

kylebaron commented 2 years ago
KatherineKayMRG commented 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