Create a pivot table
Create a pivot table
pivotr( dataset, cvars = "", nvar = "None", fun = "mean", normalize = "None", tabfilt = "", tabsort = "", nr = Inf, data_filter = "", envir = parent.frame() )
dataset |
Dataset to tabulate |
cvars |
Categorical variables |
nvar |
Numerical variable |
fun |
Function to apply to numerical variable |
normalize |
Normalize the table by row total, column totals, or overall total |
tabfilt |
Expression used to filter the table (e.g., "Total > 10000") |
tabsort |
Expression used to sort the table (e.g., "desc(Total)") |
nr |
Number of rows to display |
data_filter |
Expression used to filter the dataset before creating the table (e.g., "price > 10000") |
envir |
Environment to extract data from |
Create a pivot-table. See https://radiant-rstats.github.io/docs/data/pivotr.html for an example in Radiant
pivotr(diamonds, cvars = "cut") %>% str() pivotr(diamonds, cvars = "cut")$tab pivotr(diamonds, cvars = c("cut","clarity","color"))$tab pivotr(diamonds, cvars = "cut:clarity", nvar = "price")$tab pivotr(diamonds, cvars = "cut", nvar = "price")$tab pivotr(diamonds, cvars = "cut", normalize = "total")$tab
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.