Reputation: 11
I'm trying to add header to the first column called "TYPE"- this is the result I get:
this is the result I want:
thanks
Upvotes: 1
Views: 2737
Reputation: 110
I am not sure, my answer will be useful or not. But I faced same problem and I solved this problem in following way.
library(tidyverse)
rownames_to_column(mtcars,var = "Type") -> df
df
Thanks!!...
Upvotes: 2
Reputation: 14360
I understand correctly you want to name... the row names there is no way to do this unless you get the row names and make a column of it You seem to think row names is a column
Upvotes: 1