I'm struggling to stop receiving a NOTE about a suggested package, and it
seems to be the problem for many people. Your help is really appreciated.
In the function, I have:
if(requireNamespace("doParallel", quietly=TRUE))
{
library("doParallel")
cl = parallel::makeCluster(ncl)
doParallel::registerDoParallel(cl)
Q = foreach(i=ggID, .combine='cbind') %dopar% ## do something
} else {
## do something else
}
In DESCRIPTION, I have:
Suggests:
doParallel (>= 1.0.14)
This is the NOTE that I receive:
'library' or 'require' call to 'doParallel' in package code.
Please use :: or requireNamespace() instead.
See section 'Suggested packages' in the 'Writing R Extensions' manual.
[R-pkg-devel] NOTE for a suggested package
4 messages · Mohammad Ali Nilforooshan, Jeff Newmiller, Joshua Ulrich +1 more
Remove the library function call...
On February 23, 2019 3:43:15 PM PST, Mohammad Ali Nilforooshan <m.a.nilforooshan at gmail.com> wrote:
I'm struggling to stop receiving a NOTE about a suggested package, and
it
seems to be the problem for many people. Your help is really
appreciated.
In the function, I have:
if(requireNamespace("doParallel", quietly=TRUE))
{
library("doParallel")
cl = parallel::makeCluster(ncl)
doParallel::registerDoParallel(cl)
Q = foreach(i=ggID, .combine='cbind') %dopar% ## do something
} else {
## do something else
}
In DESCRIPTION, I have:
Suggests:
doParallel (>= 1.0.14)
This is the NOTE that I receive:
'library' or 'require' call to 'doParallel' in package code.
Please use :: or requireNamespace() instead.
See section 'Suggested packages' in the 'Writing R Extensions' manual.
[[alternative HTML version deleted]]
______________________________________________ R-package-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Sent from my phone. Please excuse my brevity.
You can remove the `library("doParallel")`. Your call to
requireNamespace() plus calling all doParallel functions with `::` is
sufficient. That should resolve the NOTE.
On Sat, Feb 23, 2019 at 5:49 PM Mohammad Ali Nilforooshan
<m.a.nilforooshan at gmail.com> wrote:
I'm struggling to stop receiving a NOTE about a suggested package, and it
seems to be the problem for many people. Your help is really appreciated.
In the function, I have:
if(requireNamespace("doParallel", quietly=TRUE))
{
library("doParallel")
cl = parallel::makeCluster(ncl)
doParallel::registerDoParallel(cl)
Q = foreach(i=ggID, .combine='cbind') %dopar% ## do something
} else {
## do something else
}
In DESCRIPTION, I have:
Suggests:
doParallel (>= 1.0.14)
This is the NOTE that I receive:
'library' or 'require' call to 'doParallel' in package code.
Please use :: or requireNamespace() instead.
See section 'Suggested packages' in the 'Writing R Extensions' manual.
[[alternative HTML version deleted]]
______________________________________________ R-package-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com R/Finance 2018 | www.rinfinance.com
On 24.02.2019 00:43, Mohammad Ali Nilforooshan wrote:
I'm struggling to stop receiving a NOTE about a suggested package, and it
seems to be the problem for many people. Your help is really appreciated.
In the function, I have:
if(requireNamespace("doParallel", quietly=TRUE))
{
library("doParallel")
Do you really need both, the namespace loaded *and* the package oin the search oath? If the former is suficient, the library(call) should be omitted. Best, Uwe Ligges
cl = parallel::makeCluster(ncl)
doParallel::registerDoParallel(cl)
Q = foreach(i=ggID, .combine='cbind') %dopar% ## do something
} else {
## do something else
}
In DESCRIPTION, I have:
Suggests:
doParallel (>= 1.0.14)
This is the NOTE that I receive:
'library' or 'require' call to 'doParallel' in package code.
Please use :: or requireNamespace() instead.
See section 'Suggested packages' in the 'Writing R Extensions' manual.
[[alternative HTML version deleted]]
______________________________________________ R-package-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel