{
tol <- 1e-6
T
}
{
#backsolve
upmat <- matrix(0,5,5)
upmat[row(upmat)<=col(upmat)] <- 1:15/4
x <- c(3,4,2,7,9)
abs(backsolve(upmat, x, k=3)[1] - 4/9) < tol
}
{
#backsolvet    # No HELP
exists("backsolvet")
}
{
#basis.tree    # Tested with tree functios
T
}
{
#binom.test
binom.test(23,100)$parameters == 100
}
{
#binomial      # Tested when testing glm's
T
}
{
#browser
#browser.default   #Interactive
#browser.ms        #Tested with ms
#browser.tree      #Tested with tree funs
T
}
{
#bs
all(dim(bs(ship,3))==c(96,3))
}
{
#bxp
#c                             # Tested throughout
T
}
{
#call
T
}
{
#cancor
soil <- evap.x[,1:3]
air <- evap.x[,-1:-3]
cc.airsoil <- cancor(air, soil)
length(cc.airsoil$cor) == 3
}
{
#care.exp        #Support for make.family
T
}
{
#cat
cat.temp <- tempfile()
cat("Bored silly.\n", file=cat.temp)
cat.ans <- scan(file=cat.temp, what="", sep="!") == "Bored silly."
	# did it write anything?
unlink(cat.temp)
cat.ans
}
{
#category
colors <- category(rep(1:3,15),labels=c("red","green","blue"))
all(!is.na(colors))
}
{
#cbind
all(dim(cbind(c(2,3,4),c(4,3,2)))==c(3,2))
}
{
#cdump           #?????????????
T
}
{
#ceiling
ceiling(-1.9)==-1
}
{
#char.expand           #Support function. No HELP file
#character
T
}
{
#charmatch   
charmatch("mea", c("mean", "median", "mode"))==1
}
{
#charplot              #Support for plot.factor
exists("charplot")
}
{
#charv.expand          #?????????  No HELP file
exists("charv.expand")
}
{
#chb
tol <- 1e-7
abs(chb(.95)$ch-1.345) < tol 
}
{
#check.factor
is.null(check.factor(colors))
}
{
#chisq.test
ct <- chisq.test(pigment$Sample,pigment$Test)
any(names(ct)== "statistic")
}
{
#chol
ccc <- cor(freeny.x)
yyy <- chol(ccc)
all(t(yyy) %*% yyy - ccc ) < tol
}
{
#choleski       # No HELP file
T
}
{
#chull
any(names(chull(corn.rain, corn.yield, peel=T))=="hull")
}
{
#class
class(kyphosis)=="data.frame"
}
{
#class<-      
kyph <- kyphosis
class(kyph) <- "data.frame.copy"
class(kyph) == "data.frame.copy"
}
{
#clear.frame   # No HELP file
T
}
{
#clorder
h <- hclust(dist(votes.repub))
ave.repub <- apply(votes.repub, 1, mean, na.rm=T)
# leaves ordered by average republican vote
h2 <- clorder(h, ave.repub)
all(diff(h2$height)>0)
}
{
#cmdscale
all(dim(cmdscale(var(cereal.attitude)))==c(8,2))
}
{
#co.intervals
E.intervals <- co.intervals(ethanol$E, 9, 0.25)
all(E.intervals[,1]<E.intervals[,2])
}
{
#codes
codes(ordered(c("cat", "dog", "frog", "dog")))[4]==2
}
{
#coef
#coefficients
free.lm <- lm(freeny.y~freeny.x[,1:2])
all(abs(coef.default(free.lm) - coef.lm(free.lm)) < tol)
}
{
#coef.listof coef.mlm
free.mlm_lm(cbind(freeny.y,freeny.y)~freeny.x[,1:2])
free.coef <- coef.mlm(free.mlm)
all(dim(free.coef) == c(3,2))
}
{
class(coef.listof(free.lm))=="listof"
}
{
#coef.ms                  # Tested after ms()
#coef.nls                 # Tested after nls()
T
}
{
#coefnames               # Support for labels.model.matrix()
T
}
{
#col
dd <- col(freeny.x)==row(freeny.x)
all(freeny.x[dd]==diag(freeny.x))
}
{
#collection              # No HELP file
T
}
{
#column.prods     # No HELP file
T
}
{
#compare
all(compare(2:1,1:2)==c(1,-1))
}
{
#complex
(complex(1)==0)
}
{
is.complex(1i)
}
{
(sqrt(as.complex(-1))-1i)< tol
}
{
#conflicts
length(conflicts(1)) < tol
}
{
all(contr.helmert(2)-c(-1,1)<tol)
}
{
all(contr.poly(2)-c(-0.7071068, 0.7071068)<tol)
}
{
all(contr.sum(2)-c(1,-1)<tol)
}
{
all(contr.treatment(2)-c(0,1)<tol)
}
{
#This is a silly test but then again so is the function
x <- 1:5
attr(x,"contrasts") <- 1
(contrasts(x) - 1 ) < tol
}
{
#contrasts<-    # No HELP file
T
}
{
#cor
as.logical(cor(1:23,5:27))
}
{
#cor.test
any(names(cor.test(lynx,log(lynx)))=="statistic")
}
{
#cos
(cos(pi)+sin(pi/2))<tol
}
{
as.logical(tan(pi/4))
}
{
#cosh
cosh(0)==1
}
{
#count.fields
T
}
{
#cov.mve
data <- freeny.x[1:12,]
# cat("Expect 'Minimum Volume Ellipsoid' message. vvv\n")
cvm <- cov.mve(data, print=F)
# cat("Expect 'Minimum Volume Ellipsoid' message. ^^^\n")
all(names(cvm)==c("cov", "center", "n.obs", "method", "objective", "stock", "births.n"))
}
#{
#cov.wt
#all(cov.wt(data)$wt==1)
#}
{
#coxreg
xx <- coxreg(c(1,1,2,2,3,4),status=c(1,0,1,1,0,1),x=c(1,1,1,0,0,0))
round((xx$var-1.576868),4) < tol
}
{
#crossprod
(crossprod(c(2,3),c(1/2,1/3))-2)<tol
}
{
#cummax
all(cummax(12:1)==12)
}
{
#cumprod
cumprod(1:5)[5]==120
}
{
#cumsum
cumsum(1:5)[5]==15
}
{
#cut
cy <- cut(corn.yield,3)
length(attr(cy,"levels"))==3
}
{
#cutree
vote.cl <- hclust(dist(votes.repub))
group <- cutree(vote.cl, k=5)  #produce 5 groups
length(attr(group,"height"))==5
}
{
#cv.tree    # Tested after tree
T
}
{
#cycle
max(cycle(ship))==12
}
