powered by
rownames(x) = y
colnames(x) = y
Wrapper for rownames(x) = y, colnames(x) = y.
setRowNames(x, names)setColNames(x, names)
setColNames(x, names)
Changed object x.
x
[matrix | data.frame] Matrix or data.frame.
matrix
data.frame
[character] New names for rows / columns.
character
setColNames(matrix(1:4, 2, 2), c("a", "b"))
Run the code above in your browser using DataLab