Reputation: 210
I have a very large matrix M and I would like the name of each row of the matrix to be Person i
, where i
is the row number. I basically want the logical equivalent of the following:
names <- vector()
for(i in 1:numberofrows) {
names[i] <- ("Person " , i)
}
rownames(M) <- names
I'm new to R so the above might not make complete syntactical sense but I'm just trying to convey the logic.
Upvotes: 0
Views: 925