quanteda / quanteda.textplots

Plotting and visualisation for quanteda
GNU General Public License v3.0
6 stars 1 forks source link

stringi warning needs to be found and fixed #9

Closed kbenoit closed 3 years ago

kbenoit commented 3 years ago

From CHECK:

W  checking dependencies in R code (2s)
   '::' or ':::' import not declared from: ‘stringi’

But I cannot find anywhere that we are using stringi for this package.

???

kbenoit commented 3 years ago

It's sneaky: it comes from utils.R where:

friendly_class_undefined_message <- quanteda:::friendly_class_undefined_message

and in the quanteda package, that function uses a stringi call:

> quanteda:::friendly_class_undefined_message
function(object_class, function_name) {
    valid_object_types <-
        utils::methods(function_name) %>%
        as.character() %>%
        stringi::stri_replace_first_fixed(paste0(function_name, "."), "")
    valid_object_types <- valid_object_types[valid_object_types != "default"]
    paste0(function_name, "() only works on ",
         paste(valid_object_types, collapse = ", "),
         " objects.")
}
<bytecode: 0x7f7f7386df50>
<environment: namespace:quanteda>

Since it's a second-order dependency anyway, I've just added it to Imports.