assign | R Documentation |
Assign a Specific Row/Column to the Column/Row Names
assign_colnames(x, ...)
assign_rownames(x, ...)
## S4 method for signature 'data.frame'
assign_rownames(x, column, remove = TRUE)
## S4 method for signature 'data.frame'
assign_colnames(x, row, remove = TRUE)
x |
A |
... |
Currently not used. |
column |
A length-one |
remove |
A |
row |
A length-one |
A data.frame
.
N. Frerebeau
Other data preparation tools:
append_column()
,
append_rownames()
,
compact()
,
count()
,
detect()
,
discard()
,
get()
,
keep()
,
seek()
X <- data.frame(
x = 1:5,
y = 6:10,
z = LETTERS[1:5]
)
## Assign column to row names
(Y <- assign_rownames(X, 3))
## Append row names to data.frame
(Z <- append_rownames(Y))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.