Cross-tabulates two columns and returns every combination with its count, the total of its row category and the share of the row total (for example the cell-type composition of each cluster).
Usage
PlotDataCrossShares(
data,
row,
column,
filter = NULL,
rows = NULL,
columns = NULL,
scale = 100
)See also
Other plot-data builders:
PlotDataBindRows(),
PlotDataConstant(),
PlotDataCount(),
PlotDataDirection(),
PlotDataDominant(),
PlotDataFromArrays(),
PlotDataJoin(),
PlotDataKeyColours(),
PlotDataLabels(),
PlotDataLonger(),
PlotDataMembership(),
PlotDataPairRatio(),
PlotDataProduct(),
PlotDataQuantiles(),
PlotDataRankRows(),
PlotDataRatio(),
PlotDataRecode(),
PlotDataRelative(),
PlotDataSelect(),
PlotDataShares(),
PlotDataSummarise(),
PlotDataUnite()
Examples
d <- data.frame(cl = c(1, 1, 2, 2, 2), type = c("a", "b", "a", "a", "c"))
PlotDataCrossShares(d, "cl", "type")
#> cl type n total share
#> 1 1 a 1 2 50.00000
#> 2 1 b 1 2 50.00000
#> 3 1 c 0 2 0.00000
#> 4 2 a 2 3 66.66667
#> 5 2 b 0 3 0.00000
#> 6 2 c 1 3 33.33333