From murdoch.duncan at gmail.com  Fri Mar  6 00:21:38 2015
From: murdoch.duncan at gmail.com (Duncan Murdoch)
Date: Thu, 05 Mar 2015 18:21:38 -0500
Subject: [Rd] Submit a package which use doParallel
In-Reply-To: <CAFin55WOa+OXsG7JEqPp1-Le1Cir+0mHrrECEbQKFkGGoTTKTQ@mail.gmail.com>
References: <CAFin55WOa+OXsG7JEqPp1-Le1Cir+0mHrrECEbQKFkGGoTTKTQ@mail.gmail.com>
Message-ID: <54F8E502.9040704@gmail.com>

On 05/03/2015 6:03 PM, Etienne Lord wrote:
> Hi,
> 
> I'm trying to submit my first package which depends on doParallel:
> 
> Depends: R (>= 3.0), igraph, doParallel

It's much better to import what you need.  If someone calls one of your
functions using :: notation, it will fail, because it won't know where
to find the doParallel objects.

> 
> Running hadley devtools: devtools::check() and devtools::release() result
> in no problem (no ERROR nor NOTE on Linux, Mac and Windows).
> 
> However, when in use the devtools::build_win() command, it results in the
> following note:
> 
> * checking R code for possible problems ... NOTE
> 
> complete_network: no visible global function definition for '%dopar%'
> complete_network: no visible global function definition for '%:%'
> complete_network: no visible global function definition for 'foreach'
> sample_network: no visible global function definition for '%dopar%'
> sample_network: no visible global function definition for 'foreach'
> 
> Googling for " no visible global function definition for '%dopar%' " result
> in a few CRAN packages with
> similar note e.g.
> http://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-fedora-clang/penDvine-00check.html
> 
> 1) Is there a special way to include the doParallel package so that this
> error do not occur?

List it in the DESCRIPTION as "Imports:  doParallel" and in your
NAMESPACE file import the functions you need.

> 
> 2) Installing the doParallel package "before" running any test on windows
> seems to remove this note. Is there any way to specify it in the
> DESCRIPTION?

That's a problem with testing within a session.  It's best to run checks
on a vanilla system, using R CMD check.

Duncan Murdoch



[Rd] Submit a package which use doParallel
Duncan Murdoch