Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8797267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:49:11+00:00 2026-06-13T23:49:11+00:00

I am trying to build an R package so reading the manual on CRAN.

  • 0

I am trying to build an R package so reading the manual on CRAN.
I could figure out that using imports to load functions in your namespace would be the best bet to use in the Description file.
After adding to the description file, I also added it to the namespace file.
I added importFrom to the namespace file with the functions required.

Now when I run R CMD check on my package,
I get an ERROR as

Namespace dependencies not required :
‘ggplot2’

Further information : Even if I add the package to the Depends in the description file, they are not getting loaded.

Please help with this.

Please find my description file below

Package: bigpackage
Type: Package
Title: Some title
Version: 1.0
Date: 2012-10-25
Author: Mayank Bansal
Maintainer: somename
Imports : R(>= 2.15.1), SweaveListingUtils( >=0.5.5),xtable(>=1.7-0),
        brew(>=1.0-6), knitr(>=0.8), RHive(>= 0.0-6), ggplot2(>=0.9.2)
        , brew, knitr
SystemRequirements : LaTeX(texi2dvi) must be present in the system to
        create PDF reports
Description: Some Description
License: file LICENSE
LazyLoad: yes
ByteCompile: true
OS_type : unix
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:49:12+00:00Added an answer on June 13, 2026 at 11:49 pm

    If you use import or importFrom in your NAMESPACE file, you should have an entry for that package in the Imports section of your DESCRIPTION file (unless there is a reason that you need to use Depends in which case the package should have an entry in Depends, and not Imports)

    Here is a relevant section of Writing R Extensions

    The ‘Imports’ field lists packages whose namespaces are imported from (as specified in the NAMESPACE file) but which do not need to be attached. Namespaces accessed by the ‘::’ and ‘:::’ operators must be listed here, or in ‘Suggests’ or ‘Enhances’ (see below). Ideally this field will include all the standard packages that are used, and it is important to include S4-using packages (as their class definitions can change and the DESCRIPTION file is used to decide which packages to re-install when this happens). Packages declared in the ‘Depends’ field should not also be in the ‘Imports’ field.


    I made a package with a single function f. I made a NAMESPACE file with the same importFrom line that you say you have in yours.

    NAMESPACE file

    export("f")
    importFrom("ggplot2","ggplot","geom_histogram")
    

    At this point, if I run R CMD check, as expected, I get an error:

    Namespace dependency not required: ‘ggplot2’

    But, if I add Imports: ggplot2 to the DESCRIPTION such that my DESCRIPTION file is as follows, it passes R CMD check with no problems.

    DESCRIPTION file

    Package: anRpackage
    Type: Package
    Title: What the package does (short line)
    Version: 1.0
    Date: 2012-11-07
    Author: Me
    Maintainer: Who to complain to <yourfault@somewhere.net>
    Description: More about what it does (maybe more than one line)
    License: GPL
    Imports: ggplot2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to build a package (libnet) in Solaris and I found that
I'm trying to build a Python package (pyregion) that contains a *.pyx file and
I am trying to build a project with the allegro-msvc80-4.2.2 pre-built package. I'm using
I'm trying to build a package which has some files under /etc that are
I'm trying to build a Python extension and package it up using distutils but
i'm trying to build a R package, but it seems that there are some
I'm trying to build my own package using Windows. I installed everything I need,
I'm trying to build a Python package for this project that includes the .json
I am trying to build a package from source and ./configure tells me I
I'm trying to find the best way to build/package an Android app for 6+

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.