Check out example codes for "r set dataframe column names". It will help you in understanding the concepts better.

Code Example 1

R> X <- data.frame(bad=1:3, worse=rnorm(3))
R> X
  bad     worse
1   1 -2.440467
2   2  1.320113
3   3 -0.306639
R> colnames(X) <- c("good", "better")
R> X
  good    better
1    1 -2.440467
2    2  1.320113
3    3 -0.306639

Code Example 2

R> colnames(X)[2] <- "superduper"

Code Example 3

colnames(dataset) <- c('name1','name2',..)

Learn ReactJs, React Native from akashmittal.com