0

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

sgibb
  • 24,656
  • 2
  • 65
  • 72
  • 1
    Please produce a sample of your data: http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – Henk Apr 12 '14 at 15:57

3 Answers3

1

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

statquant
  • 12,918
  • 18
  • 86
  • 153
1

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!!...

0
col.names(yourtable)[1] <- "Type"
Rodrigo
  • 4,239
  • 6
  • 45
  • 85