[R-pkg-devel] Submitting to CRAN a package depending on RGtk2

Duncan Murdoch murdoch.duncan at gmail.com
Fri Oct 21 00:59:57 CEST 2016


On 20/10/2016 4:14 PM, Lorenzo Busetto wrote:
> Ok. Duly noted. I'll  be more concise and avoid even simple formatting
> (seems italics broke my last post to pieces). I'll try again.
>
> My main problem is that, if I have "gWidgetRGtk2" as an imported package,
> installation on Windows from github crashes RStudio while trying to install
> GTK+ libraries (although I have no ERRORS nor WARNINGS in R CMD check).
>
> If I remove the dependency and ask users to install  "gWidgetsRGtk2"
> beforehand (which doesn't crash) I obviously get this WARNING:
>
>> checking dependencies in R code ... WARNING 'loadNamespace' or
> 'requireNamespace' call not declared from: ‘gWidgetsRGtk2’
>
> I found out I can avoid both problems  using the "pacman" package in my
> Main:
>
>> if (!pacman::p_exists("gWidgetsRGtk2", local = TRUE))
> {pacman::p_load("gWidgetsRGtk2")}
>
> In this way,  ‘gWidgetsRGtk2’ is  installed only at first execution of my
> Main, and I'm up and running.
>
> Is this a viable solution (clearly, provided I ask permission to the user
> before installing with p_load)   ?
>

No, it wouldn't be acceptable on CRAN.  You need to declare your 
dependencies.

It sounds as though there's a bug somewhere, in R, RStudio, 
gWidgetRGtk2, or Windows.  You're in the unenviable position of having 
to find and fix it.  (CRAN won't care if this only affects RStudio, and 
you might get away with an install that doesn't support Windows.)

Duncan Murdoch

> Thanks in advance,
>
> Lorenzo
>
> PS: better ?
>
>
> On 20 October 2016 at 15:34, Dirk Eddelbuettel <edd at debian.org> wrote:
>
>>
>> Lorenzo,
>>
>> Your mails are too long (at least for my attention span, and available
>> time)
>> and very poorly formatted. Many of us read email in text-only terminals.
>>
>> On 20 October 2016 at 11:05, Lorenzo Busetto wrote:
>> | I also have a (maybe stupid) question on this: in theory, I could write
>> | this "configuration check" also as a "R" function which sends out
>> "system"
>> | commands if it detects a Linux environment (configuring the commands on
>> the
>>
>> No, just use
>>
>>    Sys.info()[["sysname"]]
>>
>> and see `help(Sys.info()`.  R can tell you a lot about the environment.
>>
>> Dirk
>>
>> --
>> http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
>>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-package-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>



More information about the R-package-devel mailing list