Getting started - Naming fields in objects

It is possible to give names to each element of the vector:

Names(x) <- c(“name1”, “name2”, …)

For matrices it works nearly the same:

M <- matrix(1:6, 2 , 3)

Dimnames(M) <- list(c(“column1”, “column2”, “column3”), c(“row1”, “row2”))

Matthieu Liatard
Remember this!
Remember this
Play!
Take a quizz on this subject
Close

Hello :)
At Question-Player, we want to share more knowledge and help you never forget anything ever. And for free.

To show us your support, you can create an account:

Login / Create an account
Rate this article :
1
2
3
4
5

Up next

Related posts