File: equalBins.Rd

package info (click to toggle)
hmisc 4.2-0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 3,332 kB
  • sloc: asm: 27,116; fortran: 606; ansic: 411; xml: 160; makefile: 2
file content (41 lines) | stat: -rw-r--r-- 1,239 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
\name{equalBins}
\alias{equalBins}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{Multicolumn Formating}
\description{
  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.
}
\usage{
equalBins(widths, subwidths)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
  \item{widths}{widths of the supercolumns.}
  \item{subwidths}{list of widths of the subcolumns for each supercolumn.}
}
\details{
  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.
}
\value{
  widths of the the columns for a table.
}
\author{Charles Dupont}
\seealso{\code{\link{nchar}}, \code{\link{stringDims}}}
\examples{
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)
}
% Add one or more standard keywords, see file 'KEYWORDS' in the
% R documentation directory.
\keyword{print}