---
title: "pivotea"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{pivotea}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
```{r setup}
library(pivotea)
library(dplyr)
library(ggplot2)
```
You can use `pivot()` to make a pivot table easily.
```{r}
hogwarts |>
pivot(row = "hour", col = "wday", value = c("subject", "teacher", "room"), split = c("house", "grade"))
starwars |>
pivot(row = "homeworld", col = "species", value = "name", split = "sex")
msleep |>
pivot(row = "vore", col = "conservation", value = "name") |>
na2empty() |>
print(n = Inf)
as_tibble(Titanic) |>
pivot(row = "Age", col = c("Sex", "Survived"), value = "n", split = "Class")
diamonds |>
pivot(row = "cut", col = "color", value = "price", split = "clarity")
```