Relative Content

Tag Archive for rdplyrtidyselect

dynamic column relocating using tidyselect

My dataset contains sets of three columns: “varn_name”, “varn_desc”, and “varn_cats”, where n is a sequence of consecutive integers from 1. I’d like to order these columns so that they follow this order (i.e. “var1_name”, “var1_desc”, “var1_name”, “var2_name”, “var2_desc”, etc). n varies between datasets and has no upper limit, so I’m hoping for a solution that accommodates this variability.