Namespace dependencies not required error although I've used Imports in DESCRIPTION









up vote
1
down vote

favorite












I received the following error when running R CMD check:



Namespace dependencies not required: 'foreach' 'ggplot2' 'magrittr'



I've found a previous question and follow the answer there by making sure that the packages are included in the Imports field of my DESCRIPTION file, but I still received the error.



Here is my DESCRIPTION file



Type: Package
Title: mytitle
Version: 0.0.0.9000
Authors@R: c(
person("John", "Doe", email = "johndoe@example.com", role = c("aut", "cre")),
)
Description: More about what it does (maybe more than one line)
Use four spaces when indenting paragraphs within the Description.
License: What license is it under?
Encoding: UTF-8
LazyData: true
Depends:
R (>= 3.1)
Imports:
cowplot (>= 0.9.2),
data.table (>= 1.11.4),
doParallel (>= 1.0.11),
foreach (>= 1.2.0),
GA (>= 3.1.1),
ggplot2 (>= 2.1.0),
hydroGOF (>= 0.3.10),
magrittr (>= 1.4),
parallel (>= 3.5.0),
Rcpp (>= 0.12.16)
RoxygenNote: 6.1.0
Roxygen:
list(markdown = TRUE)
LinkingTo:
Rcpp,
RcppArmadillo
Suggests:
testthat


And here is my NAMESPACE file created by Roxygen:



export(myfunction)
import(data.table)
import(ggplot2)
importFrom(Rcpp,evalCpp)
importFrom(cowplot,plot_grid)
importFrom(doParallel,registerDoParallel)
importFrom(foreach,"%dopar%")
importFrom(foreach,foreach)
importFrom(hydroGOF,KGE)
importFrom(hydroGOF,NSE)
importFrom(hydroGOF,rmse)
importFrom(hydroGOF,ssq)
importFrom(magrittr,"%>%")
importFrom(parallel,detectCores)
importFrom(parallel,makeCluster)
importFrom(parallel,stopCluster)
useDynLib(mytitle, .registration = TRUE)


Can you please tell me what I missed?










share|improve this question























  • What are you trying to do with them? It sounds a bit like you are really wanting to use Suggests: link
    – JBGruber
    Nov 12 at 0:04










  • I need to use Imports rather than Suggests because I'm using ggplot(), %>% and foreach() in my package code.
    – Drumy
    Nov 12 at 1:28










  • For some reason, when I removed Depends: R (>= 3.1) then it works. Any idea why?
    – Drumy
    Nov 12 at 22:07














up vote
1
down vote

favorite












I received the following error when running R CMD check:



Namespace dependencies not required: 'foreach' 'ggplot2' 'magrittr'



I've found a previous question and follow the answer there by making sure that the packages are included in the Imports field of my DESCRIPTION file, but I still received the error.



Here is my DESCRIPTION file



Type: Package
Title: mytitle
Version: 0.0.0.9000
Authors@R: c(
person("John", "Doe", email = "johndoe@example.com", role = c("aut", "cre")),
)
Description: More about what it does (maybe more than one line)
Use four spaces when indenting paragraphs within the Description.
License: What license is it under?
Encoding: UTF-8
LazyData: true
Depends:
R (>= 3.1)
Imports:
cowplot (>= 0.9.2),
data.table (>= 1.11.4),
doParallel (>= 1.0.11),
foreach (>= 1.2.0),
GA (>= 3.1.1),
ggplot2 (>= 2.1.0),
hydroGOF (>= 0.3.10),
magrittr (>= 1.4),
parallel (>= 3.5.0),
Rcpp (>= 0.12.16)
RoxygenNote: 6.1.0
Roxygen:
list(markdown = TRUE)
LinkingTo:
Rcpp,
RcppArmadillo
Suggests:
testthat


And here is my NAMESPACE file created by Roxygen:



export(myfunction)
import(data.table)
import(ggplot2)
importFrom(Rcpp,evalCpp)
importFrom(cowplot,plot_grid)
importFrom(doParallel,registerDoParallel)
importFrom(foreach,"%dopar%")
importFrom(foreach,foreach)
importFrom(hydroGOF,KGE)
importFrom(hydroGOF,NSE)
importFrom(hydroGOF,rmse)
importFrom(hydroGOF,ssq)
importFrom(magrittr,"%>%")
importFrom(parallel,detectCores)
importFrom(parallel,makeCluster)
importFrom(parallel,stopCluster)
useDynLib(mytitle, .registration = TRUE)


Can you please tell me what I missed?










share|improve this question























  • What are you trying to do with them? It sounds a bit like you are really wanting to use Suggests: link
    – JBGruber
    Nov 12 at 0:04










  • I need to use Imports rather than Suggests because I'm using ggplot(), %>% and foreach() in my package code.
    – Drumy
    Nov 12 at 1:28










  • For some reason, when I removed Depends: R (>= 3.1) then it works. Any idea why?
    – Drumy
    Nov 12 at 22:07












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I received the following error when running R CMD check:



Namespace dependencies not required: 'foreach' 'ggplot2' 'magrittr'



I've found a previous question and follow the answer there by making sure that the packages are included in the Imports field of my DESCRIPTION file, but I still received the error.



Here is my DESCRIPTION file



Type: Package
Title: mytitle
Version: 0.0.0.9000
Authors@R: c(
person("John", "Doe", email = "johndoe@example.com", role = c("aut", "cre")),
)
Description: More about what it does (maybe more than one line)
Use four spaces when indenting paragraphs within the Description.
License: What license is it under?
Encoding: UTF-8
LazyData: true
Depends:
R (>= 3.1)
Imports:
cowplot (>= 0.9.2),
data.table (>= 1.11.4),
doParallel (>= 1.0.11),
foreach (>= 1.2.0),
GA (>= 3.1.1),
ggplot2 (>= 2.1.0),
hydroGOF (>= 0.3.10),
magrittr (>= 1.4),
parallel (>= 3.5.0),
Rcpp (>= 0.12.16)
RoxygenNote: 6.1.0
Roxygen:
list(markdown = TRUE)
LinkingTo:
Rcpp,
RcppArmadillo
Suggests:
testthat


And here is my NAMESPACE file created by Roxygen:



export(myfunction)
import(data.table)
import(ggplot2)
importFrom(Rcpp,evalCpp)
importFrom(cowplot,plot_grid)
importFrom(doParallel,registerDoParallel)
importFrom(foreach,"%dopar%")
importFrom(foreach,foreach)
importFrom(hydroGOF,KGE)
importFrom(hydroGOF,NSE)
importFrom(hydroGOF,rmse)
importFrom(hydroGOF,ssq)
importFrom(magrittr,"%>%")
importFrom(parallel,detectCores)
importFrom(parallel,makeCluster)
importFrom(parallel,stopCluster)
useDynLib(mytitle, .registration = TRUE)


Can you please tell me what I missed?










share|improve this question















I received the following error when running R CMD check:



Namespace dependencies not required: 'foreach' 'ggplot2' 'magrittr'



I've found a previous question and follow the answer there by making sure that the packages are included in the Imports field of my DESCRIPTION file, but I still received the error.



Here is my DESCRIPTION file



Type: Package
Title: mytitle
Version: 0.0.0.9000
Authors@R: c(
person("John", "Doe", email = "johndoe@example.com", role = c("aut", "cre")),
)
Description: More about what it does (maybe more than one line)
Use four spaces when indenting paragraphs within the Description.
License: What license is it under?
Encoding: UTF-8
LazyData: true
Depends:
R (>= 3.1)
Imports:
cowplot (>= 0.9.2),
data.table (>= 1.11.4),
doParallel (>= 1.0.11),
foreach (>= 1.2.0),
GA (>= 3.1.1),
ggplot2 (>= 2.1.0),
hydroGOF (>= 0.3.10),
magrittr (>= 1.4),
parallel (>= 3.5.0),
Rcpp (>= 0.12.16)
RoxygenNote: 6.1.0
Roxygen:
list(markdown = TRUE)
LinkingTo:
Rcpp,
RcppArmadillo
Suggests:
testthat


And here is my NAMESPACE file created by Roxygen:



export(myfunction)
import(data.table)
import(ggplot2)
importFrom(Rcpp,evalCpp)
importFrom(cowplot,plot_grid)
importFrom(doParallel,registerDoParallel)
importFrom(foreach,"%dopar%")
importFrom(foreach,foreach)
importFrom(hydroGOF,KGE)
importFrom(hydroGOF,NSE)
importFrom(hydroGOF,rmse)
importFrom(hydroGOF,ssq)
importFrom(magrittr,"%>%")
importFrom(parallel,detectCores)
importFrom(parallel,makeCluster)
importFrom(parallel,stopCluster)
useDynLib(mytitle, .registration = TRUE)


Can you please tell me what I missed?







r r-package






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 12 at 3:38

























asked Nov 11 at 23:26









Drumy

165




165











  • What are you trying to do with them? It sounds a bit like you are really wanting to use Suggests: link
    – JBGruber
    Nov 12 at 0:04










  • I need to use Imports rather than Suggests because I'm using ggplot(), %>% and foreach() in my package code.
    – Drumy
    Nov 12 at 1:28










  • For some reason, when I removed Depends: R (>= 3.1) then it works. Any idea why?
    – Drumy
    Nov 12 at 22:07
















  • What are you trying to do with them? It sounds a bit like you are really wanting to use Suggests: link
    – JBGruber
    Nov 12 at 0:04










  • I need to use Imports rather than Suggests because I'm using ggplot(), %>% and foreach() in my package code.
    – Drumy
    Nov 12 at 1:28










  • For some reason, when I removed Depends: R (>= 3.1) then it works. Any idea why?
    – Drumy
    Nov 12 at 22:07















What are you trying to do with them? It sounds a bit like you are really wanting to use Suggests: link
– JBGruber
Nov 12 at 0:04




What are you trying to do with them? It sounds a bit like you are really wanting to use Suggests: link
– JBGruber
Nov 12 at 0:04












I need to use Imports rather than Suggests because I'm using ggplot(), %>% and foreach() in my package code.
– Drumy
Nov 12 at 1:28




I need to use Imports rather than Suggests because I'm using ggplot(), %>% and foreach() in my package code.
– Drumy
Nov 12 at 1:28












For some reason, when I removed Depends: R (>= 3.1) then it works. Any idea why?
– Drumy
Nov 12 at 22:07




For some reason, when I removed Depends: R (>= 3.1) then it works. Any idea why?
– Drumy
Nov 12 at 22:07












1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










When R CMD check runs, it built a binary package .zip file on the parent folder of the package's folder, and also a folder call pkgname.check. I think the next time R CMD check runs, it may not rebuild that folder or that file, depending on whether changes have been made in the package. I deleted those file and folder and rebuild, everything works.






share|improve this answer




















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53254282%2fnamespace-dependencies-not-required-error-although-ive-used-imports-in-descript%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote



    accepted










    When R CMD check runs, it built a binary package .zip file on the parent folder of the package's folder, and also a folder call pkgname.check. I think the next time R CMD check runs, it may not rebuild that folder or that file, depending on whether changes have been made in the package. I deleted those file and folder and rebuild, everything works.






    share|improve this answer
























      up vote
      0
      down vote



      accepted










      When R CMD check runs, it built a binary package .zip file on the parent folder of the package's folder, and also a folder call pkgname.check. I think the next time R CMD check runs, it may not rebuild that folder or that file, depending on whether changes have been made in the package. I deleted those file and folder and rebuild, everything works.






      share|improve this answer






















        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        When R CMD check runs, it built a binary package .zip file on the parent folder of the package's folder, and also a folder call pkgname.check. I think the next time R CMD check runs, it may not rebuild that folder or that file, depending on whether changes have been made in the package. I deleted those file and folder and rebuild, everything works.






        share|improve this answer












        When R CMD check runs, it built a binary package .zip file on the parent folder of the package's folder, and also a folder call pkgname.check. I think the next time R CMD check runs, it may not rebuild that folder or that file, depending on whether changes have been made in the package. I deleted those file and folder and rebuild, everything works.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 30 at 9:58









        Drumy

        165




        165



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53254282%2fnamespace-dependencies-not-required-error-although-ive-used-imports-in-descript%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            這個網誌中的熱門文章

            How to read a connectionString WITH PROVIDER in .NET Core?

            Node.js Script on GitHub Pages or Amazon S3

            Museum of Modern and Contemporary Art of Trento and Rovereto