Getting 'no package called qvalue' when try to use getJaccard, cardsort

Hi all, R novice here:

Trying to use this code to analyze results from an open card sort:

compare < - function(x1, x2) {
x3 <- x1 + x2
ints <- sum(x3 > 1)
uno < - sum(x3 > 0)
return (ints / uno)

getJaccard < - function(data) {
l = length(data[1,])
jmatrix <- matrix(nrow=l,ncol=l)
for (i in 1:l) {
for (j in i:l) {
s <- compare(data[i], data[,j])
jmatrix[i,j] <- s
jmatrix[j,i] <- s
return (jmatrix)

cardsort <- function(filename, blocks) {
filedata <- read.table(filename, header=T, sep=",")
data <- getJaccard(filedata)
colnames(data) <- colnames(filedata)
hc <- hclust(dist(t(data)), method="ward")
hc$labels <- colnames(data)
plot(hc, main = Sys.time())
rect.hclust(hc, k=blocks, border="red")

I've installed the jaccard package. I'm getting an error that says -- Error: package or namespace load failed for ‘jaccard’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
there is no package called ‘qvalue’

I've searched the packages for qvalue and can't find it. Any help?

From the code that you shared, its not clear where functionality from a Jaccard package would be relevant.
I see that you have defined your own function , calling it getJaccard, which you then make use of in your cardsort function.

Its very unclear what circumstances the error you listed relate to. Does it relate to running just code you shared here. Or installing or attaching the jaccard package ?

The error came when running that full set of functions. The first time I ran it, I got an error that it couldn't find jaccard, so I installed that package. Then when I ran the full set again, I got that error. I've been troubleshooting each section / function on its own since then, and oof am I in over my head.

I'm following instructions that are from 2012, so it's probable that these functions are out of date. here are the instructions I was using:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.