-5

I simply want to change the name of the column in the matrix from "worldwide_vector" to "Worldwide". Everything is in the image.

enter image description here

Ankit Kumar
  • 397
  • 2
  • 11
  • 21
derrik bosse
  • 23
  • 1
  • 5
  • Possible duplicate of [Changing column names of a data frame](https://stackoverflow.com/questions/6081439/changing-column-names-of-a-data-frame) – Tino Nov 30 '17 at 06:12
  • 1
    Just from your last two questions, you may want to read [ask]. – Rich Scriven Nov 30 '17 at 06:23

1 Answers1

1

Since you are using a matrix, you need colnames

colnames(star_wars_matrix)[colnames(star_wars_matrix) == "worldwide_vector"] <- "Worldwide"
Tino
  • 2,091
  • 13
  • 15