[R-pkg-devel] R package which creates a directory in the user home dir

2019-10-17 Thread Sigbert Klinke

Hi,

I'am developing a package that circumvents the R package size limitation 
for data sets. For this I store the data set in the internet (currently 
GitHub) and download if it is requested.


To avoid unnecessary downloads and internet connections I create a 
directory in the users home directory to store the data there. However, 
this violates the "CRAN Repository Policy" which says


- Packages should not write in the user’s home filespace (including 
clipboards), nor anywhere else on the file system apart from the R 
session’s temporary directory (or during installation in the location 
pointed to by TMPDIR: and such usage should be cleaned up).


Do I have any chance to get the package to CRAN, if I submit it?

Best Sigbert

--
https://hu.berlin/sk
https://hu.berlin/mmstat3

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


Re: [R-pkg-devel] R package which creates a directory in the user home dir

2019-10-17 Thread Brian G. Peterson
On Thu, 2019-10-17 at 14:29 +0200, Sigbert Klinke wrote:
> Hi,
> 
> I'am developing a package that circumvents the R package size
> limitation 
> for data sets. For this I store the data set in the internet
> (currently 
> GitHub) and download if it is requested.
> 
> To avoid unnecessary downloads and internet connections I create a 
> directory in the users home directory to store the data there.
> However, 
> this violates the "CRAN Repository Policy" which says
> 
> - Packages should not write in the user’s home filespace (including 
> clipboards), nor anywhere else on the file system apart from the R 
> session’s temporary directory (or during installation in the
> location 
> pointed to by TMPDIR: and such usage should be cleaned up).
> 
> Do I have any chance to get the package to CRAN, if I submit it?

To be sure, you'd need to ask the CRAN staff, but probably not.

You could probably add an option that defaults to FALSE to persist the
data.  Then wrap that in a check.  if persist=TRUE, check to see if the
file exists.  if it exists in the subdirectory of the working
directory, then load it.  otherwise create the subdirectory of the
current working directory, load from the internet, and save the data
locally.

In this way you've had the user explicitly direct the function to save
data to disk, which is (usually) OK.

Regards,

Brian


-- 
Brian G. Peterson
ph: +1.773.459.4973
im: bgpbraverock

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


Re: [R-pkg-devel] R package which creates a directory in the user home dir

2019-10-17 Thread Enrico Schumann



Quoting Sigbert Klinke :


Hi,

I'am developing a package that circumvents the R package size  
limitation for data sets. For this I store the data set in the  
internet (currently GitHub) and download if it is requested.


To avoid unnecessary downloads and internet connections I create a  
directory in the users home directory to store the data there.  
However, this violates the "CRAN Repository Policy" which says


- Packages should not write in the user’s home filespace (including  
clipboards), nor anywhere else on the file system apart from the R  
session’s temporary directory (or during installation in the  
location pointed to by TMPDIR: and such usage should be cleaned up).


Do I have any chance to get the package to CRAN, if I submit it?

Best Sigbert

--
https://hu.berlin/sk
https://hu.berlin/mmstat3



Hi Sigbert,

there are many packages on CRAN that download data from somewhere
for their users.  They simply ask the user (or rather let the
user specify) if and where to store the data.

kind regards
Enrico

--
Enrico Schumann
Lucerne, Switzerland
http://enricoschumann.net

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


Re: [R-pkg-devel] R package which creates a directory in the user home dir

2019-10-17 Thread Martin Maechler
> Sigbert Klinke 
> on Thu, 17 Oct 2019 14:29:54 +0200 writes:

> Hi,
> I'am developing a package that circumvents the R package size limitation 
> for data sets. For this I store the data set in the internet (currently 
> GitHub) and download if it is requested.

> To avoid unnecessary downloads and internet connections I create a 
> directory in the users home directory to store the data there. However, 
> this violates the "CRAN Repository Policy" which says

> - Packages should not write in the user’s home filespace (including 
> clipboards), nor anywhere else on the file system apart from the R 
> session’s temporary directory (or during installation in the location 
> pointed to by TMPDIR: and such usage should be cleaned up).

> Do I have any chance to get the package to CRAN, if I submit it?

> Best Sigbert

> https://hu.berlin/sk
> https://hu.berlin/mmstat3


I you *prompt* the user about writing, i.e., ask them explicitly
if  is fine and only if "yes", you write there,
otherwise try to write to tempdir()  then your package is fine,
otherwise it is not, i.e,
"not okay" according to many, even if *not* on CRAN..

Best,
Martin

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


Re: [R-pkg-devel] R package which creates a directory in the user home dir

2019-10-17 Thread Iñaki Ucar
And if the user hits "yes", the package rappdirs may be useful to get
an appropriate place to save that data.

Iñaki

On Thu, 17 Oct 2019 at 14:45, Martin Maechler
 wrote:
>
> > Sigbert Klinke
> > on Thu, 17 Oct 2019 14:29:54 +0200 writes:
>
> > Hi,
> > I'am developing a package that circumvents the R package size limitation
> > for data sets. For this I store the data set in the internet (currently
> > GitHub) and download if it is requested.
>
> > To avoid unnecessary downloads and internet connections I create a
> > directory in the users home directory to store the data there. However,
> > this violates the "CRAN Repository Policy" which says
>
> > - Packages should not write in the user’s home filespace (including
> > clipboards), nor anywhere else on the file system apart from the R
> > session’s temporary directory (or during installation in the location
> > pointed to by TMPDIR: and such usage should be cleaned up).
>
> > Do I have any chance to get the package to CRAN, if I submit it?
>
> > Best Sigbert
>
> > https://hu.berlin/sk
> > https://hu.berlin/mmstat3
>
>
> I you *prompt* the user about writing, i.e., ask them explicitly
> if  is fine and only if "yes", you write there,
> otherwise try to write to tempdir()  then your package is fine,
> otherwise it is not, i.e,
> "not okay" according to many, even if *not* on CRAN..
>
> Best,
> Martin
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel



-- 
Iñaki Úcar

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


Re: [R-pkg-devel] R package which creates a directory in the user home dir

2019-10-17 Thread Hong Ooi via R-package-devel
Also, consider using the rappdirs package to write to a location that follows 
standard practice on each platform.


-Original Message-
From: R-package-devel  On Behalf Of 
Martin Maechler
Sent: Thursday, 17 October 2019 11:44 PM
To: Sigbert Klinke 
Cc: r-package-devel@r-project.org
Subject: Re: [R-pkg-devel] R package which creates a directory in the user home 
dir

> Sigbert Klinke 
> on Thu, 17 Oct 2019 14:29:54 +0200 writes:

> Hi,
> I'am developing a package that circumvents the R package size limitation 
> for data sets. For this I store the data set in the internet (currently 
> GitHub) and download if it is requested.

> To avoid unnecessary downloads and internet connections I create a 
> directory in the users home directory to store the data there. However, 
> this violates the "CRAN Repository Policy" which says

> - Packages should not write in the user’s home filespace (including 
> clipboards), nor anywhere else on the file system apart from the R 
> session’s temporary directory (or during installation in the location 
> pointed to by TMPDIR: and such usage should be cleaned up).

> Do I have any chance to get the package to CRAN, if I submit it?

> Best Sigbert

> 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fhu.berlin%2Fsk&data=02%7C01%7Chongooi%40microsoft.com%7Cb0df7ca628c34c80856d08d752ffd245%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637069131007127544&sdata=1AVL8mEcu40nIo5XsWpAMooftEGX8V4W5armhNaFsGM%3D&reserved=0
> 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fhu.berlin%2Fmmstat3&data=02%7C01%7Chongooi%40microsoft.com%7Cb0df7ca628c34c80856d08d752ffd245%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637069131007127544&sdata=sUfd89zI27LMfqUps7Hfhv%2BCvreUX4ZQJhTW1%2FGkcaY%3D&reserved=0


I you *prompt* the user about writing, i.e., ask them explicitly if  
is fine and only if "yes", you write there, otherwise try to write to tempdir() 
 then your package is fine, otherwise it is not, i.e, "not okay" according to 
many, even if *not* on CRAN..

Best,
Martin

__
R-package-devel@r-project.org mailing list
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-package-devel&data=02%7C01%7Chongooi%40microsoft.com%7Cb0df7ca628c34c80856d08d752ffd245%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637069131007127544&sdata=UwCk8xz15BVi1OCwKpyZ7usO4nYnT4KtCZm7bHEP9Kc%3D&reserved=0
__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] R package which creates a directory in the user home dir

2019-10-17 Thread Dirk Eddelbuettel


Sigbert,

One approach you could consider is to _package_ the data in a (standard R)
package upon which you can have a Suggests: relationship using a
Additional_repositories: entry in DESCRIPTION.  That is fully compliant and
compatible with the CRAN Policy, and has been done before -- in fact there is
a detailed writeup for just this case ("additional data packages") here in
the 9:1 issue of the R Journal.

   https://journal.r-project.org/archive/2017/RJ-2017-026/index.html

The paper details how to use the drat package to manage that repository but
it is worth stressing that drat is entirely optional -- everything can be
done the same way with base R functions. 

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


[R-pkg-devel] winbuilder fails for package depending on rJava

2019-10-17 Thread Danny Smith
Hi all,

I'm trying to ready a package update for CRAN, but it's failing 32 bit
Windows checks because of rJava:
```
* installing *source* package 'dialrjars' ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
*** arch - i386
Error: package or namespace load failed for 'dialrjars':
 .onLoad failed in loadNamespace() for 'rJava', details:
  call: inDL(x, as.logical(local), as.logical(now), ...)
  error: unable to load shared object
'd:/temp/RtmpO22QHg/RLIBS_1d954576818a2/rJava/libs/i386/rJava.dll':
  LoadLibrary failure:  %1 ist keine zul�ssige Win32-Anwendung.

Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'
* removing 'd:/RCompile/CRANguest/R-devel/lib/dialrjars'
```
https://win-builder.r-project.org/KpYqdgLqaPgI/00install.out

Has something changed in the winbuilder/CRAN windows testing
environment recently, and if so does anyone have any suggestions for
resolving this error?

I've submitted this and a related package and they've passed fine in
the past, but the published versions on CRAN appear to currently be
failing the Windows CRAN checks with the same error:
https://cran.r-project.org/web/checks/check_results_dialr.html
https://cran.r-project.org/web/checks/check_results_dialrjars.html

rJava itself appears to be passing fine:
https://cran.r-project.org/web/checks/check_results_rJava.html

Thanks in Advance,
Danny

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