Running 'test-as-dgCMatrix.R' [163s]
  Running 'test-empty_array.R' [165s]
  Running 'test-existence_collision.R' [2s]
  Running 'test-hash.mapping.R' [2s]
  Running 'test-hashing.R' [2s]
  Running 'test-interpret.tag.R' [175s]
  Running 'test-memcheck.R' [2s]
  Running 'test-product.R' [175s]
  Running 'test-progress_bar.R' [2s]
  Running 'test-signed.hash.R' [166s]
  Running 'test-split.R' [2s]
  Running 'test-subsetting.R' [2s]
  Running 'test-transpose.R' [2s]
Running the tests in 'tests/test-as-dgCMatrix.R' failed.
Complete output:
  > if (require(RUnit)) {
  +   library(FeatureHashing)
  +   
  +   i <- sample(1:10, 10, TRUE)
  +   x <- rnorm(10)
  +   
  +   i.bak <- integer(10)
  +   x.bak <- numeric(10)
  +   for(.i in seq_along(i)) {
  +     i.bak[.i] <- i[.i]
  +     x.bak[.i] <- x[.i]
  +   }
  +   i.bak
  +   FeatureHashing:::pair_sort(i, x)
  +   checkTrue(all.equal(x, x.bak[order(i.bak)]),
  +             "The result of pair_result is incorrect")
  +   checkTrue(all(diff(i) >= 0),
  +             "The result of pair_result is incorrect")
  +   
  +   i <- sample(1:10, 10, TRUE)
  +   x <- rnorm(10)
  +   
  +   FeatureHashing:::pair_sort(i, x)
  +   i.bak <- integer(10)
  +   x.bak <- numeric(10)
  +   for(.i in seq_along(i)) {
  +     i.bak[.i] <- i[.i]
  +     x.bak[.i] <- x[.i]
  +   }
  +   
  +   tmp <- FeatureHashing:::merge(i, x)
  +   checkTrue(isTRUE(all.equal(i[1:tmp], sort(unique(i.bak)))),
  +             "The result of C++ pair_sort and merge is incorrect")
  +   checkTrue(isTRUE(all.equal(x[1:tmp], local({
  +     retval <- sapply(split(x.bak, i.bak), sum)
  +     names(retval) <- NULL
  +     retval
  +     }))), 
  +     "The result of C++ pair_sort and merge is incorrect")
  +   
  +   contr <- list(
  +     Plant = contrasts(CO2$Plant, contrasts = FALSE),
  +     Type = contrasts(CO2$Type, contrasts = FALSE),
  +     Treatment = contrasts(CO2$Treatment, contrasts = FALSE)
  +   )
  +   
  +   m4 <- hashed.model.matrix(~ ., data = CO2, hash.size = 2^4, 
  +                             transpose = TRUE, is.dgCMatrix = FALSE)
  +   
  +   m5 <- as(m4, "dgCMatrix")
  +   m6 <- hashed.model.matrix(~ ., data = CO2, hash.size = 2^4,
  +                             transpose = TRUE)
  +   invisible(capture.output(print(m5)))
  +   stopifnot(isTRUE(all.equal(dim(m4), dim(m5))))
  +   stopifnot(isTRUE(all.equal(sum(m4@x), sum(m5@x))))
  +   stopifnot(isTRUE(all.equal(dim(m4), dim(m6))))
  +   stopifnot(isTRUE(all.equal(sum(m4@x), sum(m6@x))))
  +   for(i in seq_len(dim(m4)[2])) {
  +     e1 <- numeric(dim(m4)[2])
  +     e1[i] <- 1.0
  +     r4 <- m4 %*% e1
  +     r5 <- as.vector(m5 %*% e1)
  +     r6 <- as.vector(m6 %*% e1)
  +     stopifnot(isTRUE(all.equal(r4, r5)))
  +     stopifnot(isTRUE(all.equal(r4, r6)))
  +   }
  +   
  +   for(i in seq_len(dim(m4)[1])) {
  +     e1 <- numeric(dim(m4)[1])
  +     e1[i] <- 1.0
  +     r4 <- e1 %*% m4
  +     r5 <- as.vector(e1 %*% m5)
  +     r6 <- as.vector(e1 %*% m6)
  +     stopifnot(isTRUE(all.equal(r4, r5)))
  +     stopifnot(isTRUE(all.equal(r4, r6)))
  +   }
  + }
  Loading required package: RUnit
    [[ suppressing 84 column names '1', '2', '3' ... ]]
  > 
  > proc.time()
     user  system elapsed 
     1.46    0.26    1.71 
Running the tests in 'tests/test-empty_array.R' failed.
Complete output:
  > if (require(RUnit)) {
  +   library(FeatureHashing)
  +   df <- data.frame(a = rnorm(3), b = c("1,2", "1,,3", ",2,3"), stringsAsFactors = FALSE)
  +   m <- hashed.model.matrix(~ a * split(b), df, create.mapping = TRUE)
  +   mapping <- attr(m, "mapping")
  +   checkTrue(!"b" %in% ls(mapping), "the output contains the column corresponding to empty string")
  +   df$b <- factor(df$b)
  +   m <- hashed.model.matrix(~ a * split(b), df, create.mapping = TRUE)
  +   mapping <- attr(m, "mapping")
  +   checkTrue(!"b" %in% ls(mapping), "the output contains the column corresponding to empty string")
  + }
  Loading required package: RUnit
  [1] TRUE
  > 
  > proc.time()
     user  system elapsed 
     1.87    0.15    2.01 
Running the tests in 'tests/test-interpret.tag.R' failed.
Complete output:
  > if (require(RUnit)) {
  +   library(FeatureHashing)
  +   data(test.tag)
  +   system.time(tmp1 <- FeatureHashing:::split.character1(test.tag, ",", type = "existence"))
  +   system.time(tmp2 <- FeatureHashing:::split.character2(test.tag, ",", type = "existence"))
  +   checkTrue(isTRUE(all.equal(tmp1, tmp2)),
  +             "The split results (type existence) between R and C++ are inconsistent")
  +   
  +   system.time(tmp1 <- FeatureHashing:::split.character1(test.tag, ",", type = "count"))
  +   system.time(tmp2 <- FeatureHashing:::split.character2(test.tag, ",", type = "count"))
  +   checkTrue(isTRUE(all.equal(tmp1, tmp2)),
  +             "The split results (type count) between R and C++ are inconsistent")
  + }
  Loading required package: RUnit
  [1] TRUE
  > 
  > proc.time()
     user  system elapsed 
     1.84    0.23    2.04 
Running the tests in 'tests/test-product.R' failed.
Complete output:
  > if (require(RUnit)) {
  +   library(Matrix)
  +   library(FeatureHashing)
  +   contr <- list(
  +     Plant = contrasts(CO2$Plant, contrasts = FALSE),
  +     Type = contrasts(CO2$Type, contrasts = FALSE),
  +     Treatment = contrasts(CO2$Treatment, contrasts = FALSE)
  +     )
  +   m1 <- sparse.model.matrix(~ ., CO2, contr, transpose = TRUE)
  +   
  +   v <- numeric(dim(m1)[2])
  +   r1 <- as.vector(m1 %*% v)
  +   r2 <- FeatureHashing:::Xv(m1, v, numeric(dim(m1)[1]))
  +   checkTrue(isTRUE(all.equal(r1, r2)),
  +             "The matrix-vector multiplication is incorrect")
  +   
  +   for(i in 1:ncol(m1)) {
  +     v <- numeric(dim(m1)[2])
  +     v[i] <- 1
  +     r1 <- as.vector(m1 %*% v)
  +     r2 <- numeric(dim(m1)[1])
  +     FeatureHashing:::Xv(m1, v, r2)
  +     checkTrue(isTRUE(all.equal(r1, r2)),
  +               "The result of C++ Xv is incorrect")
  +     r <- as.vector(m1[,i])
  +   }
  +   
  +   
  +   v <- numeric(dim(m1)[1])
  +   r1 <- as.vector(v %*% m1)
  +   r2 <- FeatureHashing:::vX(v, m1, numeric(dim(m1)[2]))
  +   checkTrue(isTRUE(all.equal(r1, r2)),
  +             "The result of C++ vX is incorrect")
  +   
  +   for(i in 1:nrow(m1)) {
  +     v <- numeric(dim(m1)[1])
  +     v[i] <- 1
  +     r1 <- as.vector(v %*% m1)
  +     r2 <- numeric(dim(m1)[2])
  +     FeatureHashing:::vX(v, m1, r2)
  +     checkTrue(isTRUE(all.equal(r1, r2)),
  +               "The result of matrix-vector multiplication is incorrect")
  +   }
  + }
  Loading required package: RUnit
  > 
  > proc.time()
     user  system elapsed 
     1.45    0.21    1.67 
Running the tests in 'tests/test-signed.hash.R' failed.
Complete output:
  > if (require(RUnit)) {
  +   library(FeatureHashing)
  +   m1 <- hashed.model.matrix(~ ., iris, hash.size = 64, signed.hash = TRUE)
  +   m2 <- hashed.model.matrix(~ ., iris, hash.size = 64, signed.hash = FALSE)
  +   checkTrue(Reduce(`|`, as.matrix(m1) < 0))
  +   for(j in 1:64) {
  +     m1.sign <- sign(sum(m1[,j]))
  +     checkEqualsNumeric(m1.sign * m1[,j], m2[,j])
  +   }
  + }
  Loading required package: RUnit
  > 
  > proc.time()
     user  system elapsed 
     1.21    0.14    1.34