Message-ID: <f0a84729-f10c-49ae-3872-efe502faa623@gmail.com>
Date: 2020-12-15T13:37:29Z
From: Duncan Murdoch
Subject: [R-pkg-devel] Used package not updated - needs java < V 11
In-Reply-To: <d49373a8-6df6-7d41-e8b3-5269d0039452@krueger-family.de>
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