Skip to content

checkUsage ignores objects loaded by data()

It looks like there's no way to convince codetools that a dataset exists:

foo <- function() { data("benchmark64.data"); benchmark64.data }
bar <- function() { data("benchmark64.data", package = "bit64"); benchmark64.data }
baz <- function() { data(benchmark64.data); benchmark64.data }
bat <- function() { data(benchmark64.data, package = "bit64"); benchmark64.data }

All of these functions fail checkUsage(), e.g.:

codetools::checkUsage(foo)
<anonymous>: no visible binding for global variable ‘benchmark64.data’ (:1)