[R-pkg-devel] Dependency needs to be loaded manually even its specified in the package

David Kepplinger d@v|d@kepp||nger @end|ng |rom gm@||@com
Fri Sep 18 19:07:08 CEST 2020


Hi Núria,

I've never used qmap, but looking at the source code it seems it's not
using S3 or S4 methods in `doQmap()` but is looking for the proper method
using `exists()`. Given that your package doesn't import the required
function, it's not found by `exists()` and the `doQmap()` function
complains.

I think the only way around it is to declare the qmap package in the
Depends field, rather than the Imports field.

Best,
David

On Fri, Sep 18, 2020 at 9:39 AM Nuria Perez-Zanon <nuria.perez using bsc.es>
wrote:

> Dear all,
>
> I am maintaining a package call CSTools which is aimed for
> post-processing climate simulations.
>
> The package is already published on CRAN with all dependencies correctly
> state in DESCRIPTION, NAMESPACE and roxygen2 headers.
>
> However, when using one specific function which depends on 'qmap'
> package, I should loaded both packages by executing:
>
>      library(CSTools)
>      library(qmap)
>
> In case I don't load the second library, I get the error
>
> Error in doQmap(x = sample_cor, fobj = adjust, ...) :
>    doQmap not defined for class(fobj) ==fitQmapQUANT
>
> Has anyone an idea for needing to manually load a dependency? I provide
> a code below if someone wants to test it.
>
> Thanks in advace,
>
> Núria
>
> P.S.: Here is the code: library(CSTools) exp <- lonlat_data$exp
> obs <- lonlat_data$obs
> res <- CST_QuantileMapping(exp, obs)
>
>
>
> http://bsc.es/disclaimer
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list