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

> ### Name: popower
> ### Title: Power and Sample Size for Ordinal Response
> ### Aliases: multEventChart popower posamsize print.popower print.posamsize
> ###   pomodm simPOcuts propsPO propsTrans
> ### Keywords: htest category
> 
> ### ** Examples
> 
> # For a study of back pain (none, mild, moderate, severe) here are the
> # expected proportions (averaged over 2 treatments) that will be in
> # each of the 4 categories:
> 
> 
> p <- c(.1,.2,.4,.3)
> popower(p, 1.2, 1000)   # OR=1.2, total n=1000
Power: 0.351 
Efficiency of design compared with continuous response: 0.9 
Approximate standard error of log odds ratio: 0.116 

> posamsize(p, 1.2)
Total sample size: 3148 
Efficiency of design compared with continuous response: 0.9 

> popower(p, 1.2, 3148)
Power: 0.8 
Efficiency of design compared with continuous response: 0.9 
Approximate standard error of log odds ratio: 0.0651 

> # If p was the vector of probabilities for group 1, here's how to
> # compute the average over the two groups:
> # p2   <- pomodm(p=p, odds.ratio=1.2)
> # pavg <- (p + p2) / 2
> 
> # Compare power to test for proportions for binary case,
> # proportion of events in control group of 0.1
> p <- 0.1; or <- 0.85; n <- 4000
> popower(c(1 - p, p), or, n)    # 0.338
Power: 0.338 
Efficiency of design compared with continuous response: 0.27 
Approximate standard error of log odds ratio: 0.105 

> bpower(p, odds.ratio=or, n=n)  # 0.320
Power 
 0.32 
> # Add more categories, starting with 0.1 in middle
> p <- c(.8, .1, .1)
> popower(p, or, n)   # 0.543
Power: 0.543 
Efficiency of design compared with continuous response: 0.486 
Approximate standard error of log odds ratio: 0.0786 

> p <- c(.7, .1, .1, .1)
> popower(p, or, n)   # 0.67
Power: 0.67 
Efficiency of design compared with continuous response: 0.654 
Approximate standard error of log odds ratio: 0.0677 

> # Continuous scale with final level have prob. 0.1
> p <- c(rep(1 / n, 0.9 * n), 0.1)
> popower(p, or, n)   # 0.843
Power: 0.843 
Efficiency of design compared with continuous response: 0.999 
Approximate standard error of log odds ratio: 0.0548 

> 
> # Compute the mean and median x after shifting the probability
> # distribution by an odds ratio under the proportional odds model
> x <- 1 : 5
> p <- c(.05, .2, .2, .3, .25)
> # For comparison make up a sample that looks like this
> X <- rep(1 : 5, 20 * p)
> c(mean=mean(X), median=median(X))
  mean median 
   3.5    4.0 
> pomodm(x, p, odds.ratio=1)  # still have to figure out the right median
  mean median 
  3.50   3.67 
> pomodm(x, p, odds.ratio=0.5)
  mean median 
  3.03   2.95 
> 
> # Show variation of odds ratios over possible cutoffs of Y even when PO
> # truly holds.  Run 5 simulations for a total sample size of 300.
> # The two groups have 150 subjects each.
> s <- simPOcuts(300, nsim=5, odds.ratio=2, p=p)
> round(s, 2)
              y>=2 y>=3 y>=4 y>=5
Simulation 1  6.21 1.98 2.51 2.31
Simulation 2  4.26 2.39 1.85 1.39
Simulation 3  1.00 1.60 1.66 1.74
Simulation 4 10.64 2.34 1.76 2.38
Simulation 5  7.29 1.91 1.75 2.28
> 
> # An ordinal outcome with levels a, b, c, d, e is measured at 3 times
> # Show the proportion of values in each outcome category stratified by
> # time.  Then compute what the proportions would be had the proportions
> # at times 2 and 3 been the proportions at time 1 modified by two odds ratios 
> 
> set.seed(1)
> d   <- expand.grid(time=1:3, reps=1:30)
> d$y <- sample(letters[1:5], nrow(d), replace=TRUE)
> propsPO(y ~ time, data=d, odds.ratio=function(time) c(1, 2, 4)[time])
Warning in mean.default(x) :
  argument is not numeric or logical: returning NA
> # To show with plotly, save previous result as object p and then:
> # plotly::ggplotly(p, tooltip='label')
> 
> # Add a stratification variable and don't consider an odds ratio
> d   <- expand.grid(time=1:5, sex=c('female', 'male'), reps=1:30)
> d$y <- sample(letters[1:5], nrow(d), replace=TRUE)
> propsPO(y ~ time + sex, data=d)  # may add nrow= or ncol=
Warning in mean.default(x) :
  argument is not numeric or logical: returning NA
Warning in mean.default(x) :
  argument is not numeric or logical: returning NA
Warning in mean.default(x) :
  argument is not numeric or logical: returning NA
> 
> # Show all successive transition proportion matrices
> d   <- expand.grid(id=1:30, time=1:10)
> d$state <- sample(LETTERS[1:4], nrow(d), replace=TRUE)
> propsTrans(state ~ time + id, data=d)
Warning in mean.default(x) :
  argument is not numeric or logical: returning NA
Warning in mean.default(x) :
  argument is not numeric or logical: returning NA
Warning in mean.default(x) :
  argument is not numeric or logical: returning NA
Error in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y,  : 
  conversion failure on 'time 1 ➔ 2' in 'mbcsToSbcs': for ➔
Calls: <Anonymous> ... <Anonymous> -> heightDetails -> heightDetails.text -> grid.Call
Execution halted