
Last chance! 50% off unlimited learning
Sale ends in
Expands the width either supercolumns or the subcolumns so that the the sum of the supercolumn widths is the same as the sum of the subcolumn widths.
equalBins(widths, subwidths)
widths of the the columns for a table.
widths of the supercolumns.
list of widths of the subcolumns for each supercolumn.
Charles Dupont
This determins the correct subwidths of each of various columns in a table for printing. The correct width of the multicolumns is deterimed by summing the widths of it subcolumns.
nchar
, stringDims
mcols <- c("Group 1", "Group 2")
mwidth <- nchar(mcols, type="width")
spancols <- c(3,3)
ccols <- c("a", "deer", "ad", "cat", "help", "bob")
cwidth <- nchar(ccols, type="width")
subwidths <- partition.vector(cwidth, spancols)
equalBins(mwidth, subwidths)
Run the code above in your browser using DataLab