/usr/lib/R/site-library/GenABEL/unitTests/runit.descriptives.trait.R is in r-cran-genabel 1.7-6-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 43 44 45 46 | ### --- Test setup ---
#
# regression tests
#
if(FALSE) {
## Not really needed, but can be handy when writing tests
library(RUnit)
library(GenABEL)
}
### do not run
#stop("SKIP THIS TEST")
###
### ---- common functions and data -----
#source(paste("../inst/unitTests/shared_functions.R"))
#source(paste(path,"/shared_functions.R",sep=""))
### --- Test functions ---
test.descriptives.trait <- function()
{
data(ge03d2ex)
# this works
descriptives.trait(ge03d2ex,by.var=phdata(ge03d2ex)$sex)
# bug [#1184]
# and this does not!
checkException(descriptives.trait(ge03d2ex,by.var=sex))
attach(phdata(ge03d2ex))
descriptives.trait(ge03d2ex,by.var=sex)
detach(phdata(ge03d2ex))
descriptives.trait(ge03d2ex,by.var="sex")
phdata(ge03d2ex)$sex[2] <- NA
# bug [#1185]
# and this does not!
descriptives.trait(ge03d2ex,by.var=phdata(ge03d2ex)$sex)
descriptives.trait(ge03d2ex,by.var="sex")
# bug [#1259]
convert.snp.illumina(infile="test_markers", outfile="test.raw")
test = load.gwaa.data(pheno="test_phenos", geno="test.raw", force=T)
attach(phdata(test))
descriptives.trait(data=test, by = bt)
detach(phdata(test))
}
|