cast | R Documentation |
Pivot column data from long format to wide format.
cast(object, ...)
## S4 method for signature 'DFrame'
cast(object, colnames = "colname", values = "value")
object |
Object. |
colnames |
|
values |
|
... |
Additional arguments. |
DataFrame
.
Updated 2023-08-23.
https://seananderson.ca/2013/10/19/reshape/
reshape2::dcast
(deprecated).
tidyr::pivot_wider
.
Python pandas.pivot_table
.
Python pandas.wide_to_long
.
Python pandas.DataFrame.pivot
.
data(matrix, package = "AcidTest")
## DFrame ====
long <- melt(matrix)
print(long)
wide <- cast(long)
print(wide)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.