/usr/lib/R/site-library/gdata/unitTests/runit.drop.levels.R is in r-cran-gdata 2.13.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 42 | ### runit.drop.levels.R
###------------------------------------------------------------------------
### What: Tests for drop.levels
### $Id: runit.drop.levels.R 993 2006-10-30 17:10:08Z ggorjan $
### Time-stamp: <2006-08-29 14:21:12 ggorjan>
###------------------------------------------------------------------------
### {{{ --- Test setup ---
if(FALSE) {
library("RUnit")
library("gdata")
}
### }}}
### {{{ --- drop.levels ---
test.drop.levels <- function()
{
f <- factor(c("A", "B", "C", "D"))[1:3]
fDrop <- factor(c("A", "B", "C"))
l <- list(f=f, i=1:3, c=c("A", "B", "D"))
lDrop <- list(f=fDrop, i=1:3, c=c("A", "B", "D"))
df <- as.data.frame(l)
dfDrop <- as.data.frame(lDrop)
checkIdentical(drop.levels(f), fDrop)
checkIdentical(drop.levels(l), lDrop)
checkIdentical(drop.levels(df), dfDrop)
}
### }}}
### {{{ Dear Emacs
## Local variables:
## folded-file: t
## End:
### }}}
###------------------------------------------------------------------------
### runit.drop.levels.R ends here
|