@Kevin Zen,
I was having the same issue, but I think I just resolved it by using the "importFrom" field in the namespace file. I use Roxygen2 to document, so I simply included the tag:
#' @importFrom foreach %dopar%
with the function foreach is called in. It created a field in the namespace file like such:
importFrom(foreach,"%dopar%")
so if you aren't using Roxygen2, you could just put that line in your namespace and that should do the trick as well.
That should prevent the cran check from complaining. However, once you try to run the code on a computer that doesn't already have the "foreach" package loaded and attached via:
library(foreach)
you will get a message that %dopar% is not found if "foreach" is listed under "Imports" rather than "Depends" in your DESCRIPTION file. So make sure foreach is listed in the "Depends" field.
foreach::foreach(i = 1:9, .combine = "+") foreach::`%dopar%` {i}
and i've tried various combination with the backticks, but it usually gives an "unexpected symbol" error. Thanks! – Stenotypy