powered by
Transforms a matrix to a long data.frame.
matrix
data.frame
wide_to_long(from, ...)to_long(from, ...)# S4 method for matrix wide_to_long(from, factor = FALSE, reverse = FALSE)# S4 method for matrix to_long(from, factor = FALSE, reverse = FALSE)
to_long(from, ...)
# S4 method for matrix wide_to_long(from, factor = FALSE, reverse = FALSE)
# S4 method for matrix to_long(from, factor = FALSE, reverse = FALSE)
A coerced object.
An object to be coerced.
Currently not used.
A logical scalar: should character string be coerced to factor? Default to FALSE, if TRUE the original ordering is preserved.
logical
factor
FALSE
TRUE
A logical scalar: should the order of factor levels be reversed? Only used if factor is TRUE. Useful for plotting.
N. Frerebeau
Other transformation tools: append(), assign()
append()
assign()
## Create a matrix A <- matrix(data = sample(0:10, 100, TRUE), nrow = 20, ncol = 5) ## Transform to long data.frame head(wide_to_long(A))
Run the code above in your browser using DataLab