Closed naupaka closed 5 years ago
Thanks for your thorough and detailed issue! Seems like there have been some changes to the koRpus pkg that I need to catch up with. I have encountered a slightly different issue to you in running the tests locally and on travis, so it seems like there are few things that need attention!
I've added the koRpus.lang.en requirement in there now, but that doesn't solve my test failure, so I'll keep looking.
unable to find an inherited method for function 'describe' for signature '"NULL"'
1: wordcountaddin:::text_stats_fn_(eleven_words) at testthat/test_wordcountaddin.R:7
2: sylly::describe(k1) at G:/My Documents/My Various Things/wordcountaddin/R/hello.R:239
3: (function (classes, fdef, mtable)
{
methods <- .findInheritedMethods(classes,
fdef, mtable)
if (length(methods) == 1L)
return(methods[[1L]])
else if (length(methods) ==
0L) {
cnames <- paste0("\"",
vapply(classes, as.character,
""), "\"", collapse = ", ")
stop(gettextf("unable to find an inherited method for function %s for signature %s",
sQuote(fdef@generic),
sQuote(cnames)), domain = NA)
}
else stop("Internal error in finding inherited methods; didn't return a unique method",
domain = NA)
})(list("NULL"), new("standardGeneric",
.Data = function (obj)
standardGeneric("describe"),
generic = structure("describe", package = "sylly"),
package = "sylly", group = list(),
valueClass = character(0),
signature = "obj", default = NULL,
skeleton = (function (obj)
stop("invalid call in method dispatch to 'describe' (no default method)",
domain = NA))(obj)), <environment>)
4: stop(gettextf("unable to find an inherited method for function %s for signature %s",
sQuote(fdef@generic), sQuote(cnames)),
domain = NA)
== testthat results =========
OK: 0 SKIPPED: 0 FAILED: 1
1. Error: (unknown) (@test_wordcountaddin.R#7)
Green light on travis with https://github.com/benmarwick/wordcountaddin/commit/ad4e077dbd7b3fb5c45c654f225feb85a90dc602, so I think we might have got on top of this one. Would you mind to try and let me know what you see?
Works great in a fresh rocker/rstudio docker container, so I think it should be good to go! Thanks for the quick fix -- I'm using this add-in in my bioinformatics class this semester.
As of the last few days (weeks?), word count fails on the template Rmd file in RStudio with the following error:
It fails both with a filename specified, as well as with interactive use (e.g. cursor in Rmd file, select from addin menu).
Debugging led me to the problem, which is in the non-exported
prep_text_korpus()
function. This fails because by default (?) the commanddoesn't install the necessary korPus language packages, as described here:
When in debugging mode, this is the error:
I was able to resolve this issue with
koRpus::install.koRpus.lang("en")
and then load the package (library(koRpus.lang.en)
) before running thewordcountaddin::test_stats()
function.Perhaps the solution is to add koRpus.lang.en to the list of imports?
or at least issue a warning that the language package needs to be installed?
Here's the spot where that is called in the wordcountaddin code:
https://github.com/benmarwick/wordcountaddin/blob/cbe935973723220d7545f0c3b3f6be6d8d234146/R/hello.R#L212
My session_info: