user1984762
user1984762

Reputation: 11

add header to the first column

I'm trying to add header to the first column called "TYPE"- this is the result I get: enter image description here

this is the result I want: enter image description here

thanks

Upvotes: 1

Views: 2737

Answers (3)

Rajkumar ManiRaja
Rajkumar ManiRaja

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

statquant
statquant

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

Rodrigo
Rodrigo

Reputation: 5119

col.names(yourtable)[1] <- "Type"

Upvotes: 0

Related Questions