File: wild-codes.R

package info (click to toggle)
r-cran-memisc 0.99.31.8.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 2,136 kB
  • sloc: ansic: 5,117; makefile: 2
file content (11 lines) | stat: -rw-r--r-- 225 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
setMethod("wild.codes","item",function(x){
  vl <- labels(x)
  vvl <- vl@values
  use <- !(x %in% vvl)
  N <- length(x)
  x <- x@.Data[use]
   
  tab <- Table(x,counts=TRUE,percentage=TRUE)
  tab[,2] <- 100*tab[,1]/N
  tab
})