I am developing a package that depends on the package What am I missing? There is a similar question, but it does not discuss this specific warning. If you intend to use code from those packages in your package, you should call this Mostly, you want to import 'package and some, or all, for export functions / symbols available for your package. You can add such packages to your And likewise, announce that you want to write all in the > By doing this, In the context of a package, the main use of And then you can include In short: If you are importing packages to use only those packages exported to the namespace of that package, then you can send your package to EDIT: In newer versions of R, the foo , and in my package code Call the exported code from
foo I have included the package name in the
NAMESPACE in the
Import (Af) declaration, and
import Under: line
description file However, I get the following warning when
RCM check :
r 'library 'Or' require 'call can not be declared Yes: 'foo'
library (& lt ); Pkg & gt;) . The error message is a little confusing - it's telling you that you have placed the
requirement or
library in your code, but in reality (properly) those calls are not declared In your
DESCRIPTION file.
library /
call ; Rather, you need to declare them properly (and how you're using them) in your
DESCRIPTION file.
DESCRIPTION file in the
Import: field - e.g.
Import: & lt; Pkg & gt;
NAMESPACE file using the symbols exported from that package ,
Import
& lt; Pkg & gt; All functions in the namespace are automatically provided and therefore it is not necessary for
requirement anywhere in your code.
is that which you want to make only conditionally, for example, suppose that you write the function that Handles a very specific conspiracy arrangement, which requires
foo , but
foo is not required in your package otherwise, if you include code Want to do the conditional package
foo Depending on it, you can write something in this form:
(if required ("foo")) {#do stuff}
foo under
DESCRIPTION instead of
sequence:
import: . Another example is a package that is not required by the users of your package.
Library or
is not needed anywhere in the code.
RCM check if you use
, , warns it, And instead you suggest that you use
requireNamespace . In that case, you can follow the pattern:
## Use the 'bar' function from the package 'Foo' (if required requires "name" ("foo", quietly = TRUE)) {foo :: Bar ()}
No comments:
Post a Comment