Do we need library(xxxx)?

Everything related to the development of modules in jamovi
Post Reply
User avatar
mcfanda@gmail.com
Posts: 452
Joined: Thu Mar 23, 2017 9:24 pm

Do we need library(xxxx)?

Post by mcfanda@gmail.com »

Hi
I understood that required packages are listed in DESCRIPTION file, under Imports. As far as understood, one does not need to call library() within the module. However, I'm working on a module and libraries are not loaded (not even jvmcore). If I call library(xxx) within the .run() or any other function .foo() within the R6::R6Class() module, it works fine. Is that correct?
User avatar
jonathon
Posts: 2609
Joined: Fri Jan 27, 2017 10:04 am

Re: Do we need library(xxxx)?

Post by jonathon »

hi,

it's no different to an R package (because it is an R package). so you either need the full namespace:

packageName::functionName(),

or an import statement in your NAMESPACE file -- then you can just go:

functionName()

cheers

jonathon
User avatar
mcfanda@gmail.com
Posts: 452
Joined: Thu Mar 23, 2017 9:24 pm

Re: Do we need library(xxxx)?

Post by mcfanda@gmail.com »

got it, thanks
Post Reply