Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What is the function to set column names for a matrix?

a) names()
b) colnames()
c) col.names()
d) column name cannot be set for a matrix

Answer: b
Explanation: colnames() is the function to set column names for a matrix. rownames() is the function to set row names for a matrix. But we can’t use both at a time. Column names and row names can be set separately using the colnames() and rownames() functions.

Join The Discussion