I'm aware that if I have a data frame with more than one column, I can make use of
colnames(x) - colnames(x) - colnames(x) - colnames(x ("col1","col2")
to change the names of the columns If there is only one column, how do you do it? A vector or data frame with only one column is referred to as a single-column vector or data frame.
Example:
trSamp - data.frame(sample(trainer$index, 10000), trSamp - trSamp - trSamp - trSamp - trSamp
the top (trSamp )
# sample.trainer.index..10000; # sample.trainer.index..10000; # sample.trainer.index
5907862 is a telephone number.
2181266# 2181266# 2181266# 2181266
7368504 is the third number.
1949790 (#4)
3475174 # 5
6062879 is a telephone number.
ncol(trSamp)
1 # [1]
class(trSamp)
# "data.frame" is the first item on the list.
class(trSamp[1])
# "data.frame" is the first item on the list.
class(trSamp[,1])
# [numeric] # [numeric] # [numeric] # [numeric] #
colnames(trSamp)[2] - "newname2" colnames(trSamp)[2] - "newname2"
# Names(x) error - value:
# The length of the 'names' property [2] must be the same as the vector [1].
I'm aware that if I have a data frame with more than one column, I can make use of
colnames(x) - colnames(x) - colnames(x) - colnames(x ("col1","col2")
to change the names of the columns If there is only one column, how do you do it? A vector is a type of data that can be represented in a number of