unpivot | R Documentation |
From a pivot_table
object put column(s) back as rows.
unpivot(x)
x |
A |
a data.table
.
library(flexpivot)
library(magrittr)
data("nobel_laureates")
# Revert format
nobel_laureates %>%
pivot_table(
rows = "category",
cols = c("gender", "birth_continent")
) %>%
unpivot()
nobel_laureates %>%
pivot_table(
rows = "category",
cols = "birth_continent"
) %>%
unpivot()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.