I have a data frame which I am dcasting using the reshape2 package, and I would like to remove the first column and have it become the row names of
dcast
reshape2
with the later version of tibble, a more elegant solution exists:
tibble
df <- df %>% pivot(.) %>% tibble::column_to_rownames('ID_full')
Importantly, it works also when the column to turn to the rowname is passed as a variable, which is super-convenient, when inside the function!