Running examples in 'Hmisc-Ex.R' failed
The error most likely occurred in:

> ### Name: summaryP
> ### Title: Multi-way Summary of Proportions
> ### Aliases: summaryP plot.summaryP ggplot.summaryP latex.summaryP
> ### Keywords: hplot category manip
> 
> ### ** Examples
> 
> n <- 100
> f <- function(na=FALSE) {
+   x <- sample(c('N', 'Y'), n, TRUE)
+   if(na) x[runif(100) < .1] <- NA
+   x
+ }
> set.seed(1)
> d <- data.frame(x1=f(), x2=f(), x3=f(), x4=f(), x5=f(), x6=f(), x7=f(TRUE),
+                 age=rnorm(n, 50, 10),
+                 race=sample(c('Asian', 'Black/AA', 'White'), n, TRUE),
+                 sex=sample(c('Female', 'Male'), n, TRUE),
+                 treat=sample(c('A', 'B'), n, TRUE),
+                 region=sample(c('North America','Europe'), n, TRUE))
> d <- upData(d, labels=c(x1='MI', x2='Stroke', x3='AKI', x4='Migraines',
+                  x5='Pregnant', x6='Other event', x7='MD withdrawal',
+                  race='Race', sex='Sex'))
Input object size:	 9336 bytes;	 12 variables	 100 observations
New object size:	10808 bytes;	12 variables	100 observations
> dasna <- subset(d, region=='North America')
> with(dasna, table(race, treat))
          treat
race        A  B
  Asian     8  8
  Black/AA  8 13
  White     8  7
> s <- summaryP(race + sex + ynbind(x1, x2, x3, x4, x5, x6, x7, label='Exclusions') ~
+               region + treat, data=d)
> # add exclude1=FALSE below to include female category
> plot(s, groups='treat')
> ggplot(s, groups='treat')
> 
> plot(s, val ~ freq | region * var, groups='treat', outerlabels=FALSE)
> # Much better looking if omit outerlabels=FALSE; see output at
> # http://biostat.mc.vanderbilt.edu/HmiscNew#summaryP
> # See more examples under bpplotM
> 
> ## For plotly interactive graphic that does not handle variable size
> ## panels well:
> ## require(plotly)
> ## g <- ggplot(s, groups='treat')
> ## ggplotly(g, tooltip='text')
> 
> ## For nice plotly interactive graphic:
> ## options(grType='plotly')
> ## plot(s, groups='treat')
> 
> 
> # Make a chart where there is a block of variables that
> # are only analyzed for males.  Keep redundant sex in block for demo.
> # Leave extra space for numerators, denominators
> sb <- summaryP(race + sex +
+                pBlock(race, sex, label='Race: Males', subset=sex=='Male') ~
+                region, data=d)
Error in 1:d[2] : argument of length 0
Calls: summaryP ... xtfrm.default -> as.vector -> rank -> .gt -> [ -> [.pBlock
Execution halted