|
I'm a beginner using checklist, so perhaps my question is easy to answer. When checking the grammar in a commit with lintr, I get a lot of warnings like "no visible global function definition for '%>%'" or "no visible global function definition for 'bind_rows'," which are due to the lack of a specific reference to the package they originate from. |
Replies: 1 comment 1 reply
|
I suppose you use An alternative is to use the In case of |
I suppose you use
bind_rows()in a function? Instead of loading the package at the top of the script, you should load the package inside the function. See the example below. Note that I userequire()instead oflibrary().require()loads the package aslibrary()does but it returns a TRUE or FALSE depending on R was able to load the package. Wrapping that instead of astopifnot()ensures that your function errors when then package is not available.An alternative is to use the
package::functionnotation. E.g.dplyr::bind_rows().In case of
%>%, it is easier to replace it with the base pipe|>.