File: multcompLetters3.R

package info (click to toggle)
r-cran-multcompview 0.1-10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 268 kB
  • sloc: makefile: 2
file content (15 lines) | stat: -rw-r--r-- 433 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"multcompLetters3" <- 
function (z, y , x, data, ...) {
  y.z  <- tapply(data[, y], data[, z], 
    function(x) do.call(mean, list(x=x)))
  oz <- order(y.z, decreasing= T )
  #This is to handle interactions
  if (length(z > 1)) {
    Lvls <- levels(interaction(data[, z], sep = ":"))[oz]
  } else {
    Lvls <- levels(data[, z])[oz]
  }
  value <- vec2mat(x)
  value <- value[Lvls, Lvls]
  multcompLetters(value, ...)
}