Running ‘lsa-tests.R’ [1s/1s]
Running the tests in ‘tests/lsa-tests.R’ failed.
Complete output:
  > ### 
  > ### testing routines for LSA package
  > ### 
  > 
  > Sys.setenv(NOAWT=TRUE)
  > 
  > library(lsa)
  Loading required package: SnowballC
  > 
  > lsatest <- function(test, description) {
  +     if (!test) stop(description)
  + }
  > 
  > # -  -  -  -  -  -  -  -  -  -  -  -  -  -  
  > # testing cosine
  > 
  > a = c(2,1,1,1,0)
  > b = c(0,0,0,1,0)
  > lsatest( (round(cosine(a,b),3) == 0.378), "[cosine] - vector comparison");
  > 
  > m = cbind(a,b,a,a);
  > simm = round(cosine(m),2);
  > sims = c(1, 0.38, 1, 1, 0.38, 1, 0.38, 0.38, 1, 0.38, 1, 1, 1, 0.38, 1, 1);
  > dim(sims) = c(4,4);
  > lsatest( all(simm==sims), "[cosine] - matrix comparison");
  > 
  > # -  -  -  -  -  -  -  -  -  -  -  -  -  -  
  > # routines for get/set/delTriples
  > 
  > myTextMatrix = matrix(2,2,3);
  > colnames(myTextMatrix) = c("c1","c2","c3");
  > rownames(myTextMatrix) = c("dog","cat");
  > environment(myTextMatrix) = new.env();
  > class(myTextMatrix) = "textmatrix";
  > 
  > setTriple(myTextMatrix, "c1", "has_category", 15)
  > setTriple(myTextMatrix, "c1", "has_category", 11)
  > setTriple(myTextMatrix, "c3", "has_category", 20)
  > setTriple(myTextMatrix, "c2", "has_category", 20)
  > setTriple(myTextMatrix, "c1", "has_category", 20)
  > 
  > lsatest( all( (getTriple(myTextMatrix)[[1]] == as.vector(c("1", "1", "3", "2", "1"))) == TRUE), "[triples] - getTriple(all) subjects");
  > lsatest( all( (getTriple(myTextMatrix)[[2]] == as.vector(rep("has_category", 5))) == TRUE), "[triples] - getTriple(all) predicates");
  > lsatest( all( (getTriple(myTextMatrix)[[3]] == as.vector(c("15","11","20","20","20"))) == TRUE), "[triples] - getTriple(all) objects");
  > 
  > lsatest( all( (getTriple(myTextMatrix, "c1")[[1]] == as.vector(rep("has_category",3))) == TRUE), "[triples] - getTriple(c1) predicates" )
  > lsatest( all( (getTriple(myTextMatrix, "c1")[[2]] == as.vector(c("15","11","20"))) == TRUE), "[triples] - getTriple(c1) objects")
  > 
  > lsatest( getTriple(myTextMatrix, "c2")[[1]][1] == "has_category", "[triples] - getTriple(c2) predicates")
  > lsatest( getTriple(myTextMatrix, "c2")[[2]][1] == "20", "[triples] - getTriple(c2) objects")
  > 
  > lsatest( all( (getTriple(myTextMatrix, "c1", "has_category") == c("15","11","20")) ), "[triples] - getTriple(c1,has_category) objects")
  > 
  > delTriple(myTextMatrix, "c1", "has_category", 11)
  > 
  > lsatest( all( (getTriple(myTextMatrix, "c1")[[1]] == as.vector(rep("has_category",2))) == TRUE), "[triples] - deletion, predicates")
  > lsatest( all( (getTriple(myTextMatrix, "c1")[[2]] == as.vector(c("15","20"))) == TRUE), "[triples] - deletion, objects")
  > 
  > setTriple(myTextMatrix, "c1", "has_category", 17)
  > 
  > lsatest( all( (getTriple(myTextMatrix)[[1]] == as.vector(c("1", "3", "2", "1", "1"))) == TRUE), "[triples] - insertion after deletion, subjects")
  > lsatest( all( (getTriple(myTextMatrix)[[2]] == as.vector(rep("has_category", 5))) == TRUE), "[triples] - insertion after deletion, predicates" )
  > lsatest( all( (getTriple(myTextMatrix)[[3]] == as.vector(c("15","20","20","20","17"))) == TRUE), "[triples] - insertion after deletion, objects")
  > 
  > # -  -  -  -  -  -  -  -  -  -  -  -  -  -  
  > # routines for textmatrix
  > 
  > # create landauer example with files
  > td = tempfile()
  > dir.create(td)
  > write( c("human", "interface", "computer"), file=paste(td,"/c1", sep=""))
  > write( c("survey", "user", "computer", "system", "response", "time"), file=paste(td,"/c2", sep=""))
  > write( c("EPS", "user", "interface", "system"), file=paste(td,"/c3", sep=""))
  > write( c("system", "human", "system", "EPS"), file=paste(td,"/c4", sep=""))
  > write( c("user", "response", "time"), file=paste(td,"/c5", sep=""))
  > write( c("trees"), file=paste(td,"/m1", sep=""))
  > write( c("graph", "trees"), file=paste(td,"/m2", sep=""))
  > write( c("graph", "minors", "trees"), file=paste(td,"/m3", sep=""))
  > write( c("graph", "minors", "survey"), file=paste(td,"/m4", sep=""))
  > 
  > # -  -  -  -  -  -  -  -  -  -  -  -  -  -  
  > # test normal matrix
  > 
  > dtm = textmatrix(td)
  > lsatest( all( rownames(dtm) == c("computer", "human",  "interface", "response", "survey", "system", "time", "user", "eps", "trees", "graph", "minors")), "[textmatrix] - landauer, terms")
  Error in lsatest(all(rownames(dtm) == c("computer", "human", "interface",  : 
    [textmatrix] - landauer, terms
  Execution halted