tests/dense_matrix_pairwise.R

library(coop)
set.seed(1234)

n <- 21
x = matrix(rnorm(n), 3)
x[sample(n, size=6)] = NA 

t1 <- cov(x, use="pair")
t2 <- covar(x, use="pair")

stopifnot(all.equal(t1, t2))

t1 <- cor(x, use="pair")
t2 <- pcor(x, use="pair")

stopifnot(all.equal(t1, t2))

Try the coop package in your browser

Any scripts or data that you put into this service are public.

coop documentation built on Sept. 19, 2021, 5:07 p.m.