I am trying to create an R package with a function using the J
of data.table.
When I run R CMD check
, I have a NOTE : no visible global function definition for 'J'
although I've added data.table as a dependency in the DESCRIPTION file.
Package: rfPred
Type: Package
Title: Assign rfPred functional prediction scores to a missense variants list
Version: 1.0
Date: 2013-03-14
Author: me
Maintainer:me
Depends: data.table
[..]
I've tried to use another function of the data.table package in the package I want to create, but I haven't the same problem as for J.
Do you have a solution ?
J()
as an independent function has been removed from data.table
. It is only for use inside DT[...]
, where it still works. But for packages depending on data.table
and using J()
correctly, like yours, an extra step is required to avoid the NOTE (see below).
First the background and why J()
was removed. Extracts from NEWS :
As an aside, there was also a recent related thread on r-devel :
http://r.789695.n4.nabble.com/conflict-between-rJava-and-data-table-tp4659935p4659984.html
Now for the NOTE produced by R CMD check
on your package
Your package is using J()
inside DT[...]
and working fine. The only issue is the NOTE from R CMD check :
no visible global function definition for 'J'
Here are all the known options :
J
by list
. It's equivalent.J=NULL
somewhere in your package. (We looked at data.table
exporting J=NULL
so you wouldn't have to but decided not to since any data.table
user typing J
at the prompt would see NULL
which may be confusing.)?utils::globalVariables
as Ben Bolker suggested in comments.Further background on this particular NOTE is in this related question :
No visible binding for global variable Note in R CMD check
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With