dropLast: Drop last facets of array

View source: R/tab.R

dropLastR Documentation

Drop last facets of array

Description

Primarily used to strips totals from a table bordered by totals by dropping the last facet.

Usage

dropLast(arr, drop = FALSE, keep = NULL)

Arguments

arr

array

drop

drop parameter in subsetting, default FALSE

keep

names of facets to be kept, default NULL

Examples

(arr <- array(1:24,2:4))
arr %>% dropLast
arr %>% dropLast(drop = TRUE)
tab(iris, ~ Species)
tab(iris, ~ Species) %>% dropLast 
tab(iris, ~ Species + I(Sepal.Length > 5)) %>% dropLast 
# row percentages:
tab(iris, ~ Species + I(Sepal.Length > 5), pct= 1)
tab(iris, ~ Species + I(Sepal.Length > 5), pct= 1) %>% dropLast
tab(iris, ~ Species + I(Sepal.Length > 5), pct= 1) %>% dropLast(keep = "All")

gmonette/spida2 documentation built on Aug. 11, 2024, 7:52 p.m.