trinker / qdap

Quantitative Discourse Analysis Package: Bridging the gap between qualitative data and quantitative analysis
http://cran.us.r-project.org/web/packages/qdap/index.html
175 stars 44 forks source link

Single sentence bug in `pos` #150

Closed trinker closed 10 years ago

trinker commented 10 years ago

Per Kurt Hornik

When calling pos on a single sentence:

R> qdap::pos("This is a sentence.")
  |======================================================================| 100%
Error in `colnames<-`(`*tmp*`, value = "prop") :
  attempt to set 'colnames' on an object with less than two dimensions
Calls: <Anonymous> -> colnames<-

From a quick look:

Browse[2]>
debug: G5 <- sapply(data.frame(G4, check.names = FALSE), function(x) cons *
    (x/m2$word.count))
Browse[2]>
debug: colnames(G5) <- paste0("prop", colnames(G5))
Browse[2]>
Error in `colnames<-`(`*tmp*`, value = "prop") :
  attempt to set 'colnames' on an object with less than two dimensions
Calls: <Anonymous> -> colnames<-

so I guess sapply is dropping all dimensions?