[R-pkg-devel] Publishing Java Wrappers The Right Way

2020-11-16 Thread Peter Meissner
Hey Everyone,

I have an R-package that wraps some Java code.
The dependencies needed are around 10MB.

Thus I split the package into 2 packages. One providing only the
dependencies:

https://github.com/petermeissner/kafkaesquejars

... and one providing the actual code:

https://github.com/petermeissner/kafkaesque


I submitted the first package to CRAN and it came back stating that:
"Package has FOSS license, installs .class/.jar but has no 'java' directory.
"

Of course there is no java directory because the package does not contain
any code, just dependencies
and those are placed in ./inst/java.

Now what to do? In response I added  ./java/sources.md file and listed all
dependencies as well as URLs where
the source code of those dependencies can be downloaded.

Is this correct? Do I miss something else?


I really would appreciate some guidance on doing this right.

Best, Peter

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Having shiny as an optional dependency

2020-11-16 Thread Kamil Stachowski
I did briefly wonder why your reply to me cited an email from Akshit Achara
who asked about third party C++ API. I assumed it was because the solution
to his problem and mine was the same.

In the meantime, I got a reply from Kurt Hornik who said I have a top-level
call

soundcorrsGUI <- shiny::shinyApp (ui, server)
>

so what I should really do is to move "shiny" from "Suggests" to "Imports".
I don't want to do this, however, because the GUI is just an addition, the
package is perfectly usable without it. I wrapped "soundcorrsGUI" in a
function:

soundcorrsGUI <- function () {
>
> if (!requireNamespace("shiny",quietly=T) ||
> !requireNamespace("shinyjqui",quietly=T))
> stop ("\"soundcorrsGUI\" requires packages \"shiny\" and \"shinyjqui\".")
>
> shiny::shinyApp (ui, server)
>
> }
>

and this seems to solve the problem with "shiny", but now I have a problem
with "shinyjqui". I actually only need one function from it: in the call to
"shinyApp" above,

ui <- shiny::navbarPage ([…] ui.soundchanges […])
>

where

ui.soundchanges <- shiny::fluidPage ([…]
> shinyjqui::sortableCheckboxGroupInput […])
>

I tried wrapping "ui.soundchanges" in a function in the same way as I did
with "soundcorrsGUI" but this doesn't help.

Is there a way to make it work without turning "shiny" and "shinyjqui" into
obligatory dependencies?

Best wishes,
Kamil Stachowski

On Mon, 16 Nov 2020, 00:55 Uwe Ligges, 
wrote:

> On 14.11.2020 19:53, Kamil Stachowski wrote:
> > This is actually what I do. Before you replied, I was told to write to
> CRAN
> > and explain, and they will decide whether the packages will be installed
> on
> > CRAN machines. Thank you for your help nonetheless.
>
> No, I told you about a "third party C++ API" you asked for, not about an
> R package. R packages  from BioC + CRAN should be availabe on CRAN, in
> that case it is a problem in your package.
>
> Best,
> Uwe Ligges
>
>
> >
> > Best,
> > Kamil
> >
> > On Sat, 14 Nov 2020 at 19:39, Gábor Csárdi 
> wrote:
> >
> >> You probably import functions from shiny. Don't do that, refer to them
> >> with the `::` operator instead.
> >>
> >> Gabor
> >>
> >> On Sat, Nov 14, 2020 at 6:12 PM Kamil Stachowski
> >>  wrote:
> >>>
> >>> I wrote a package that contains a graphical interface written with
> >> packages
> >>> "shiny" and "shinyjqui". My package can also be used from the CLI, so I
> >>> listed both "shiny" and "shinyjqui" as optional dependencies. I ran R
> CMD
> >>> check --as-cran on my computer in R 3.6.3 and devel, and both passed
> >>> without any errors or warnings. However, when I tried uploading the
> >> package
> >>> to CRAN, I got this error:
> >>>
> >>> Error in loadNamespace(x) : there is no package called ‘shiny’
> >>> Error: unable to load R code in package ‘soundcorrs’
> >>> Execution halted
> >>> ERROR: lazy loading failed for package ‘soundcorrs’
> >>>
> >>> How can I fix this?
> >>>
> >>>  [[alternative HTML version deleted]]
> >>>
> >>> __
> >>> R-package-devel@r-project.org mailing list
> >>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
> >>
> >
> >
>

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Having shiny as an optional dependency

2020-11-16 Thread Duncan Murdoch

On 16/11/2020 4:55 a.m., Kamil Stachowski wrote:

I did briefly wonder why your reply to me cited an email from Akshit Achara
who asked about third party C++ API. I assumed it was because the solution
to his problem and mine was the same.

In the meantime, I got a reply from Kurt Hornik who said I have a top-level
call

soundcorrsGUI <- shiny::shinyApp (ui, server)




so what I should really do is to move "shiny" from "Suggests" to "Imports".
I don't want to do this, however, because the GUI is just an addition, the
package is perfectly usable without it. I wrapped "soundcorrsGUI" in a
function:

soundcorrsGUI <- function () {


if (!requireNamespace("shiny",quietly=T) ||
!requireNamespace("shinyjqui",quietly=T))
stop ("\"soundcorrsGUI\" requires packages \"shiny\" and \"shinyjqui\".")

shiny::shinyApp (ui, server)

}



and this seems to solve the problem with "shiny", but now I have a problem
with "shinyjqui". I actually only need one function from it: in the call to
"shinyApp" above,

ui <- shiny::navbarPage ([…] ui.soundchanges […])




where

ui.soundchanges <- shiny::fluidPage ([…]

shinyjqui::sortableCheckboxGroupInput […])



I tried wrapping "ui.soundchanges" in a function in the same way as I did
with "soundcorrsGUI" but this doesn't help.

Is there a way to make it work without turning "shiny" and "shinyjqui" into
obligatory dependencies?


If you never call shinyjqui::sortableCheckboxGroupInput except in that 
one place, then you should put that call within the requireNamespace 
test.  Things I'd change there:


 - Do not use T, use TRUE.

 - Wrap *everything* that requires those packages in the 
requireNamespace test.


 - Make sure your example code in help pages never calls that function 
unless shiny and shinyjqui are present, by a test similar to the above 
but a positive one:


if (requireNamespace("shiny") && requireNamespace("shinyjqui")) {

   # example code

}

Duncan Murdoch




Best wishes,
Kamil Stachowski

On Mon, 16 Nov 2020, 00:55 Uwe Ligges, 
wrote:


On 14.11.2020 19:53, Kamil Stachowski wrote:

This is actually what I do. Before you replied, I was told to write to

CRAN

and explain, and they will decide whether the packages will be installed

on

CRAN machines. Thank you for your help nonetheless.


No, I told you about a "third party C++ API" you asked for, not about an
R package. R packages  from BioC + CRAN should be availabe on CRAN, in
that case it is a problem in your package.

Best,
Uwe Ligges




Best,
Kamil

On Sat, 14 Nov 2020 at 19:39, Gábor Csárdi 

wrote:



You probably import functions from shiny. Don't do that, refer to them
with the `::` operator instead.

Gabor

On Sat, Nov 14, 2020 at 6:12 PM Kamil Stachowski
 wrote:


I wrote a package that contains a graphical interface written with

packages

"shiny" and "shinyjqui". My package can also be used from the CLI, so I
listed both "shiny" and "shinyjqui" as optional dependencies. I ran R

CMD

check --as-cran on my computer in R 3.6.3 and devel, and both passed
without any errors or warnings. However, when I tried uploading the

package

to CRAN, I got this error:

Error in loadNamespace(x) : there is no package called ‘shiny’
Error: unable to load R code in package ‘soundcorrs’
Execution halted
ERROR: lazy loading failed for package ‘soundcorrs’

How can I fix this?

  [[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel









[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel



__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Having shiny as an optional dependency

2020-11-16 Thread Kamil Stachowski
It works! Thank you so much!

Best wishes,
Kamil Stachowski

On Mon, 16 Nov 2020 at 11:53, Duncan Murdoch 
wrote:

> On 16/11/2020 4:55 a.m., Kamil Stachowski wrote:
> > I did briefly wonder why your reply to me cited an email from Akshit
> Achara
> > who asked about third party C++ API. I assumed it was because the
> solution
> > to his problem and mine was the same.
> >
> > In the meantime, I got a reply from Kurt Hornik who said I have a
> top-level
> > call
> >
> > soundcorrsGUI <- shiny::shinyApp (ui, server)
> >>
> >
> > so what I should really do is to move "shiny" from "Suggests" to
> "Imports".
> > I don't want to do this, however, because the GUI is just an addition,
> the
> > package is perfectly usable without it. I wrapped "soundcorrsGUI" in a
> > function:
> >
> > soundcorrsGUI <- function () {
> >>
> >> if (!requireNamespace("shiny",quietly=T) ||
> >> !requireNamespace("shinyjqui",quietly=T))
> >> stop ("\"soundcorrsGUI\" requires packages \"shiny\" and
> \"shinyjqui\".")
> >>
> >> shiny::shinyApp (ui, server)
> >>
> >> }
> >>
> >
> > and this seems to solve the problem with "shiny", but now I have a
> problem
> > with "shinyjqui". I actually only need one function from it: in the call
> to
> > "shinyApp" above,
> >
> > ui <- shiny::navbarPage ([…] ui.soundchanges […])
> >>
> >
> > where
> >
> > ui.soundchanges <- shiny::fluidPage ([…]
> >> shinyjqui::sortableCheckboxGroupInput […])
> >>
> >
> > I tried wrapping "ui.soundchanges" in a function in the same way as I did
> > with "soundcorrsGUI" but this doesn't help.
> >
> > Is there a way to make it work without turning "shiny" and "shinyjqui"
> into
> > obligatory dependencies?
>
> If you never call shinyjqui::sortableCheckboxGroupInput except in that
> one place, then you should put that call within the requireNamespace
> test.  Things I'd change there:
>
>   - Do not use T, use TRUE.
>
>   - Wrap *everything* that requires those packages in the
> requireNamespace test.
>
>   - Make sure your example code in help pages never calls that function
> unless shiny and shinyjqui are present, by a test similar to the above
> but a positive one:
>
> if (requireNamespace("shiny") && requireNamespace("shinyjqui")) {
>
> # example code
>
> }
>
> Duncan Murdoch
>
>
> >
> > Best wishes,
> > Kamil Stachowski
> >
> > On Mon, 16 Nov 2020, 00:55 Uwe Ligges, 
> > wrote:
> >
> >> On 14.11.2020 19:53, Kamil Stachowski wrote:
> >>> This is actually what I do. Before you replied, I was told to write to
> >> CRAN
> >>> and explain, and they will decide whether the packages will be
> installed
> >> on
> >>> CRAN machines. Thank you for your help nonetheless.
> >>
> >> No, I told you about a "third party C++ API" you asked for, not about an
> >> R package. R packages  from BioC + CRAN should be availabe on CRAN, in
> >> that case it is a problem in your package.
> >>
> >> Best,
> >> Uwe Ligges
> >>
> >>
> >>>
> >>> Best,
> >>> Kamil
> >>>
> >>> On Sat, 14 Nov 2020 at 19:39, Gábor Csárdi 
> >> wrote:
> >>>
>  You probably import functions from shiny. Don't do that, refer to them
>  with the `::` operator instead.
> 
>  Gabor
> 
>  On Sat, Nov 14, 2020 at 6:12 PM Kamil Stachowski
>   wrote:
> >
> > I wrote a package that contains a graphical interface written with
>  packages
> > "shiny" and "shinyjqui". My package can also be used from the CLI,
> so I
> > listed both "shiny" and "shinyjqui" as optional dependencies. I ran R
> >> CMD
> > check --as-cran on my computer in R 3.6.3 and devel, and both passed
> > without any errors or warnings. However, when I tried uploading the
>  package
> > to CRAN, I got this error:
> >
> > Error in loadNamespace(x) : there is no package called ‘shiny’
> > Error: unable to load R code in package ‘soundcorrs’
> > Execution halted
> > ERROR: lazy loading failed for package ‘soundcorrs’
> >
> > How can I fix this?
> >
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-package-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-package-devel
> 
> >>>
> >>>
> >>
> >
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-package-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-package-devel
> >
>
>

-- 
Kamil Stachowski, PhD
Chair of General and Indo-European Linguistics
Jagiellonian University, Cracow, Poland
http://info.filg.uj.edu.pl/zhjij/~stachowski.kamil/

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] Debugging library.dynam to include a manual shared object

2020-11-16 Thread Jon Davidson
Hello,

I am trying to build an R package with a manually compiled .so file. To do
so, I have included a call to useDynLib() in my NAMESPACE file.

Building this works fine in RStudio with devtools::load_all('.'), but when
I try to run R CMD INSTALL, I get the error: package or namespace load
failed in library.dynam(lib, package, package.lib): shared object
'filename.so' not found.

Is there any way I can debug library.dynam to see where it's looking for my
.so and why it can't find it? Thanks for your help!

Best,
Jon

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel