Google News
logo
R - Quiz(MCQ)
Which of the following statement changes column name to h and f?
A)
rownames(m) <- c(“f”, “f”)
B)
rownames(m) <- c(“h”, “f”)
C)
columnnames(m) <- c(“h”, “f”)
D)
colnames(m) <- c(“h”, “f”)

Correct Answer :   colnames(m) <- c(“h”, “f”)


Explanation : Column names and row names can be set separately using the colnames() and rownames() functions.

Advertisement