benmarwick / JSTORr

Simple text mining of journal articles from JSTOR's Data for Research service
Other
71 stars 18 forks source link

(findassocs) #5

Closed josswhittaker closed 11 years ago

josswhittaker commented 11 years ago

View(findassocs) findassocs <- JSTOR_findassocs(unpack, corpus, n = 10, "agriculture", corlimit=0.8, plimit=0.05) Error in data.frame(value, row.names = rn, check.names = FALSE, check.rows = FALSE) : row.names should specify one of the variables Error in data.frame(value, row.names = rn, check.names = FALSE, check.rows = FALSE) : row.names should specify one of the variables Error in data.frame(value, row.names = rn, check.names = FALSE, check.rows = FALSE) : row.names should specify one of the variables Error in data.frame(value, row.names = rn, check.names = FALSE, check.rows = FALSE) : row.names should specify one of the variables Error in data.frame(value, row.names = rn, check.names = FALSE, check.rows = FALSE) : row.names should specify one of the variables Error in rbind(deparse.level, ...) : numbers of columns of arguments do not match

benmarwick commented 11 years ago

Even with the revised function this gives:

findassocs <- JSTOR_findassocs(unpack1grams, nouns, n = 10, "agriculture", corlimit=0.8, plimit=0.05) Error in if (nrow(x.cor[x.cor[, 2] < plimit, ]) == 0) { : argument is of length zero

with 7L

I'll have a closer look... probably the control structure to manage null output when the corlimit is too high isn't quite working...

benmarwick commented 11 years ago

This was returning a single row matrix in a few places that was foiling nrow(...matrix...). Added , drop = FALSE in a few key places to fix this. It's working well now for these specific parameters.