How to import and also attach/load another package in a building package

I want to use another package A in my package, so I've added the roxygen comment

#' @importFrom packageA functionB

However, only when pacakgeA is attached (doing something like library(packageA)) then functions in it can be used, otherwise it will return errors like 'cannot connect to the server'.

So is there a way to import and attach the package? Thanks.

I found that adding the packageA under Depends rather than Imports in the DESCRIPTION, then the packageA can be attached when loading my package.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.