[R-pkg-devel] Used package not updated - needs java < V 11

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Tue Dec 15 14:37:29 CET 2020


On 15/12/2020 8:02 a.m., Knut Krueger wrote:
> I am using in my Package XlConnect. If the Computer is using Java < 11
> all is working. But if not, the package can not be used.
> 
> 
> inside teh functions tehre is an ' @importFrom XLConnect createSheet
> writeWorksheet saveWorkbook
> 
> but only used for additional comfort to use excel sheets
> 
> The package is usable without XlConnect if I change
> 
> Imports:  igraph,chron,gdata, XLConnect
> to
> Imports:
>       igraph,chron,gdata
> Suggests:XLConnect
> 
> but then I get the error
> 
> checking package dependencies ... ERROR
>     Namespace dependency not required: ‘XLConnect’
> 
> Just now the new version is on my private repository and working with or
> without Xlconnect depending on the java version
> 
> 
> How can I submit the package to cran  until XlConnect is working with
> java > 11

You should not have

@importFrom XLConnect createSheet writeWorksheet saveWorkbook

in your ROxygen comments; that results in an unconditional import. 
Instead, you should use fully qualified calls each time, i.e.

XLConnect::createSheet, XLConnect::writeWorksheet, XLConnect::saveWorkbook

in your code.  You should also wrap every use of those functions in 
checks like

if (requireNamespace("XLConnect")) {
   run code
} else {
   report that you can't run that code
}

and make sure none of your examples or vignettes fail if XLConnect is 
not present.

Duncan Murdoch



More information about the R-package-devel mailing list