Re: [R-pkg-devel] Error in CHECK caused by dev.off()

2020-07-23 Thread William Dunlap
R-4.0 introduced a new function, tools::R_user_dir(package, which),
where which is one of "data", "config", and "cache".  It gives
standard directory names in which to place package-and-user-specific
files which you want to last longer than one R session.

I suppose you will still have to ask the user if it is ok to use those
directories, but you might want to put your log files in one of them
instead of in ~/ itself.

Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Thu, Jul 23, 2020 at 2:15 PM Helmut Schütz  wrote:
>
> Hi Dirk,
>
> Dirk Eddelbuettel wrote on 2020-07-23 15:16:
> > Helmut,
> >
> > For previous uploads you affirmed that you read the CRAN Repository Policy
> > which states
> >
> >   [...]
> >
> > Your package appears to violate that requirement.
>
> As I wrote previously the statement continues with
> "Limited exceptions may be allowed in interactive sessions if the
> package obtains confirmation from the user."
>
> I'm not a native speaker of English but for me "should not write" !=
> "must not write".
>
> >   I would fix the package.
>
> I removed the automatic switch to "~/" if no path is given. As before I
> recommend in the man-pages to give the full path. However, I _still_
> state that "~/" _can_ be used for convenience.
> The package is used in a regulated environment. The output file contains
> an entire audit-trail (name of the user and system, version and date of
> the OS, R, all packages, functions used, time of execution, blablah). If
> the package would write to tempdir() I would have to add a warning in
> bold font of every man-page like "Execute the command tempdir() to find
> out where your result files reside. Copy the files to a safe location
> before you quit the R-session. If you fail to do so, your results will
> be lost."
>
> Off topic: I don't like it that on Windows tempdir is located at
> "C:/Users/{Username}/AppData/Local/Temp/Rtmp..." I strictly separate my
> OSes (on C), software (on D), data (on E), backups (on F). Writing to
> the system disk is not what I prefer. However, in my installation "~/"
> resolves to "E:/Users/{Username}/Documents/"...
>
> --
> Ing. Helmut Schütz
> BEBAC – Consultancy Services for
> Bioequivalence and Bioavailability Studies
> Neubaugasse 36/11
> 1070 Vienna, Austria
> T +43 1 2311746
> M +43 699 10792458
> E helmut.schu...@bebac.at
> W https://bebac.at/
> C https://bebac.at/Contact.htm
> F https://forum.bebac.at/
> GIS 24799386, VAT ATU61115625, DUNS 300370568, EORI ATEOS196209
> GDPR https://bebac.at/Data-Protection.htm
>
> __
> 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] Error in CHECK caused by dev.off()

2020-07-23 Thread Duncan Murdoch

On 23/07/2020 5:11 p.m., Helmut Schütz wrote:

Hi Dirk,

Dirk Eddelbuettel wrote on 2020-07-23 15:16:

Helmut,

For previous uploads you affirmed that you read the CRAN Repository Policy
which states

   [...]

Your package appears to violate that requirement.


As I wrote previously the statement continues with
"Limited exceptions may be allowed in interactive sessions if the
package obtains confirmation from the user."

I'm not a native speaker of English but for me "should not write" !=
"must not write".


And "may be allowed" is not "will be allowed".




   I would fix the package.


I removed the automatic switch to "~/" if no path is given. As before I
recommend in the man-pages to give the full path. However, I _still_
state that "~/" _can_ be used for convenience.


This is a little unclear (perhaps the language issue again).  It's fine 
if your documentation recommends the user choose that.  That's a 
variation on what I recommended to you (that you generate an error 
message that suggests how to avoid the error).


I don't agree with it if you mean to say the CRAN policy gets it wrong, 
and you should be allowed to have your original automatic fallback.



The package is used in a regulated environment. The output file contains
an entire audit-trail (name of the user and system, version and date of
the OS, R, all packages, functions used, time of execution, blablah). If
the package would write to tempdir() I would have to add a warning in
bold font of every man-page like "Execute the command tempdir() to find
out where your result files reside. Copy the files to a safe location
before you quit the R-session. If you fail to do so, your results will
be lost."

Off topic: I don't like it that on Windows tempdir is located at
"C:/Users/{Username}/AppData/Local/Temp/Rtmp..." I strictly separate my
OSes (on C), software (on D), data (on E), backups (on F). Writing to
the system disk is not what I prefer. However, in my installation "~/"
resolves to "E:/Users/{Username}/Documents/"...


It can resolve anywhere you like (as long as its writable), by 
specifying the TMPDIR environment variable.


Duncan Murdoch

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


Re: [R-pkg-devel] Check Error Due to Unicode in Documentation

2020-07-23 Thread bill
Thanks for the quick response both Duncan and Gábor.  I've reported it here in 
case others want to follow-up there: 
https://github.com/r-lib/roxygen2/issues/1121

-Original Message-
From: Gábor Csárdi  
Sent: Thursday, July 23, 2020 5:25 PM
To: Duncan Murdoch 
Cc: b...@denney.ws; R Package Devel 
Subject: Re: [R-pkg-devel] Check Error Due to Unicode in Documentation

On Thu, Jul 23, 2020 at 9:58 PM Duncan Murdoch  wrote:
>
> On 23/07/2020 4:14 p.m., b...@denney.ws wrote:
[...]
>
> If you change the source to include the explicit characters (i.e. use 
> pattern = c("μ", "µ") instead of pattern=c("\u03bc", "\u00b5")), does 
> that help?
>
> It may cause other issues:  WRE recommends against including UTF-8 
> chars in source code.
>
> If that doesn't solve the problem, then it looks like an issue with 
> Roxygen2.  I don't know if there's a way to tell it not to convert \u 
> escapes into the corresponding character.  If there isn't, it seems 
> like that's something they should add.  As a workaround, is there a 
> way to say that this one particular .Rd file should be edited by hand, 
> instead of auto-generated?

I don't think roxygen2 intentionally converts \u sequences, I think this is 
just a consequence of the parse() + deparse() roundtrip:

x <- '"\\u03bc"'
charToRaw(x)
#>  [1] 22 5c 75 30 33 62 63 22
y <- deparse(eval(parse(text = x)))
charToRaw(y)
#> [1] 22 b5 22

Bill, please report a roxygen2 issue at
https://github.com/r-lib/roxygen2/issues and we can probably fix this.
Thanks!

Gabor

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


Re: [R-pkg-devel] Check Error Due to Unicode in Documentation

2020-07-23 Thread Gábor Csárdi
On Thu, Jul 23, 2020 at 10:25 PM Gábor Csárdi  wrote:
>
> On Thu, Jul 23, 2020 at 9:58 PM Duncan Murdoch  
> wrote:
> >
> > On 23/07/2020 4:14 p.m., b...@denney.ws wrote:
[...]
> Bill, please report a roxygen2 issue at
> https://github.com/r-lib/roxygen2/issues and we can probably fix this.
[...]

Btw. you can possibly work around this by manually providing the
@usage for this one function.

Gabor

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


Re: [R-pkg-devel] Check Error Due to Unicode in Documentation

2020-07-23 Thread Gábor Csárdi
On Thu, Jul 23, 2020 at 9:58 PM Duncan Murdoch  wrote:
>
> On 23/07/2020 4:14 p.m., b...@denney.ws wrote:
[...]
>
> If you change the source to include the explicit characters (i.e. use
> pattern = c("μ", "µ") instead of pattern=c("\u03bc", "\u00b5")), does
> that help?
>
> It may cause other issues:  WRE recommends against including UTF-8 chars
> in source code.
>
> If that doesn't solve the problem, then it looks like an issue with
> Roxygen2.  I don't know if there's a way to tell it not to convert \u
> escapes into the corresponding character.  If there isn't, it seems like
> that's something they should add.  As a workaround, is there a way to
> say that this one particular .Rd file should be edited by hand, instead
> of auto-generated?

I don't think roxygen2 intentionally converts \u sequences, I think
this is just a consequence of the parse() + deparse() roundtrip:

x <- '"\\u03bc"'
charToRaw(x)
#>  [1] 22 5c 75 30 33 62 63 22
y <- deparse(eval(parse(text = x)))
charToRaw(y)
#> [1] 22 b5 22

Bill, please report a roxygen2 issue at
https://github.com/r-lib/roxygen2/issues and we can probably fix this.
Thanks!

Gabor

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


Re: [R-pkg-devel] Error in CHECK caused by dev.off()

2020-07-23 Thread Helmut Schütz

Hi Dirk,

Dirk Eddelbuettel wrote on 2020-07-23 15:16:

Helmut,

For previous uploads you affirmed that you read the CRAN Repository Policy
which states

  [...]

Your package appears to violate that requirement.


As I wrote previously the statement continues with
"Limited exceptions may be allowed in interactive sessions if the 
package obtains confirmation from the user."


I'm not a native speaker of English but for me "should not write" != 
"must not write".



  I would fix the package.


I removed the automatic switch to "~/" if no path is given. As before I 
recommend in the man-pages to give the full path. However, I _still_ 
state that "~/" _can_ be used for convenience.
The package is used in a regulated environment. The output file contains 
an entire audit-trail (name of the user and system, version and date of 
the OS, R, all packages, functions used, time of execution, blablah). If 
the package would write to tempdir() I would have to add a warning in 
bold font of every man-page like "Execute the command tempdir() to find 
out where your result files reside. Copy the files to a safe location 
before you quit the R-session. If you fail to do so, your results will 
be lost."


Off topic: I don't like it that on Windows tempdir is located at 
"C:/Users/{Username}/AppData/Local/Temp/Rtmp..." I strictly separate my 
OSes (on C), software (on D), data (on E), backups (on F). Writing to 
the system disk is not what I prefer. However, in my installation "~/" 
resolves to "E:/Users/{Username}/Documents/"...


--
Ing. Helmut Schütz
BEBAC – Consultancy Services for
Bioequivalence and Bioavailability Studies
Neubaugasse 36/11
1070 Vienna, Austria
T +43 1 2311746
M +43 699 10792458
E helmut.schu...@bebac.at
W https://bebac.at/
C https://bebac.at/Contact.htm
F https://forum.bebac.at/
GIS 24799386, VAT ATU61115625, DUNS 300370568, EORI ATEOS196209
GDPR https://bebac.at/Data-Protection.htm

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


Re: [R-pkg-devel] Check Error Due to Unicode in Documentation

2020-07-23 Thread Duncan Murdoch

On 23/07/2020 4:14 p.m., b...@denney.ws wrote:

Hello,

  


I have a personal package that I�d eventually like to clean up and either
find other packages to be homes for the functions or perhaps eventually
release it on CRAN.  To that end, I try to keep package checks working.

  


One of the functions that I use is to try to simplify Unicode text to ASCII.
With that, I tend to receive data that is scientifically-focused to the mu
character should be converted to a �u� instead of the standard conversion to
�m�.  On top of that, there are at least two Unicode characters that are
visually the mu character, one is the micro character and the other is an
actual lowercase mu.  This function converts both of those to �u� as
desired.

  


I generate the documentation using roxygen2, but the text in the
documentation aligns with the expected Unicode character, so I think the
issue is not with roxygen.

  


The issue is that Codoc gives the following error:

  


* checking for code/documentation mismatches ... WARNING

Codoc mismatches from documentation object 'unicode_to_ascii':

unicode_to_ascii.character

   Code: function(x, verbose = FALSE, pattern = c("μ", "µ"), replacement

  = c("u", "u"), general_

  


But, the code and documentation appear to be the same.  I think that the
issue relates to something with Unicode support in Codoc, but I�m not sure
how to test for that.  The code is here:

  


https://github.com/billdenney/bsd.report/blob/454caf217c5b333af1d65c7e63bbad
4194320e07/R/unicode_to_ascii.R#L28-L31

  


And the documentation is here:

  


https://github.com/billdenney/bsd.report/blob/454caf217c5b333af1d65c7e63bbad
4194320e07/man/unicode_to_ascii.Rd#L17-L24

  


Do you have any suggestions on how to make this code/documentation work with
Codoc?


If you change the source to include the explicit characters (i.e. use 
pattern = c("μ", "µ") instead of pattern=c("\u03bc", "\u00b5")), does 
that help?


It may cause other issues:  WRE recommends against including UTF-8 chars 
in source code.


If that doesn't solve the problem, then it looks like an issue with 
Roxygen2.  I don't know if there's a way to tell it not to convert \u 
escapes into the corresponding character.  If there isn't, it seems like 
that's something they should add.  As a workaround, is there a way to 
say that this one particular .Rd file should be edited by hand, instead 
of auto-generated?


Duncan Murdoch

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


Re: [R-pkg-devel] Error in CHECK caused by dev.off()

2020-07-23 Thread Helmut Schütz

Hi Sebastian,

Sebastian Meyer wrote on 2020-07-23 16:52:

Back to the original topic:


THX!


Calling graphics.off() in example code will also disturb standard R CMD
check. Before running the examples, R CMD check opens a pdf device to
store any graphics output [1]. You will find the resulting pdf file in
{PACKAGE}.Rcheck/{PACKAGE}-Ex.pdf after R CMD check.


Ah! For years I was wondering where the PDF comes from.


R CMD check will eventually fail from trying to close this pdf device
after running the examples [2], if you have already closed all graphics
devices (including this pdf device) through code in your examples. This
is where the

Error in grDevices::dev.off() :
   cannot shut down device 1 (the null device)
Execution halted

actually came from.


OK, now I have:
if (file.exists("myfile") & !is.null(dev.list()["png"]) {
  invisible(dev.off(dev.list()["png"]))
}
You made my day. No error in check() any more.


Finally, […] the png device may not even be available.


Ouch!


So it is reasonable to condition on
capabilities("png")


Done.


  or to put such examples in \donttest.


It was already in \donttest{} but check() ignored that.


HTH!


It did. Additionally I've learned a new abbreviation...

Helmut

--
Ing. Helmut Schütz
BEBAC – Consultancy Services for
Bioequivalence and Bioavailability Studies
Neubaugasse 36/11
1070 Vienna, Austria
E helmut.schu...@bebac.at
W https://bebac.at/
F https://forum.bebac.at/

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


[R-pkg-devel] Check Error Due to Unicode in Documentation

2020-07-23 Thread bill
Hello,

 

I have a personal package that I�d eventually like to clean up and either
find other packages to be homes for the functions or perhaps eventually
release it on CRAN.  To that end, I try to keep package checks working.

 

One of the functions that I use is to try to simplify Unicode text to ASCII.
With that, I tend to receive data that is scientifically-focused to the mu
character should be converted to a �u� instead of the standard conversion to
�m�.  On top of that, there are at least two Unicode characters that are
visually the mu character, one is the micro character and the other is an
actual lowercase mu.  This function converts both of those to �u� as
desired.

 

I generate the documentation using roxygen2, but the text in the
documentation aligns with the expected Unicode character, so I think the
issue is not with roxygen.

 

The issue is that Codoc gives the following error:

 

* checking for code/documentation mismatches ... WARNING

Codoc mismatches from documentation object 'unicode_to_ascii':

unicode_to_ascii.character

  Code: function(x, verbose = FALSE, pattern = c("μ", "µ"), replacement

 = c("u", "u"), general_

 

But, the code and documentation appear to be the same.  I think that the
issue relates to something with Unicode support in Codoc, but I�m not sure
how to test for that.  The code is here:

 

https://github.com/billdenney/bsd.report/blob/454caf217c5b333af1d65c7e63bbad
4194320e07/R/unicode_to_ascii.R#L28-L31

 

And the documentation is here:

 

https://github.com/billdenney/bsd.report/blob/454caf217c5b333af1d65c7e63bbad
4194320e07/man/unicode_to_ascii.Rd#L17-L24

 

Do you have any suggestions on how to make this code/documentation work with
Codoc?

 

Thanks,

 

Bill


[[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] Error in CHECK caused by dev.off()

2020-07-23 Thread Sebastian Meyer
Back to the original topic: graphics.off() is probably not what you
want. It shuts down *all* open graphics devices, not just the current
one. Example code or your plotting functions should not do that.

Calling graphics.off() in example code will also disturb standard R CMD
check. Before running the examples, R CMD check opens a pdf device to
store any graphics output [1]. You will find the resulting pdf file in
{PACKAGE}.Rcheck/{PACKAGE}-Ex.pdf after R CMD check. [BTW, the plots
therein will be usefully annotated with the names of the originating
help pages.]

R CMD check will eventually fail from trying to close this pdf device
after running the examples [2], if you have already closed all graphics
devices (including this pdf device) through code in your examples. This
is where the

Error in grDevices::dev.off() :
  cannot shut down device 1 (the null device)
Execution halted

actually came from.

Finally, many of the graphics devices are platform-specific and the png
device may not even be available. So it is reasonable to condition on
capabilities("png") or to put such examples in \donttest. The latter is
also used in the example code for grDevices::png, at least in the Unix
version of the man page [3].

HTH!

Sebastian


[1]: file.path(R.home("share"), "R", "examples-header.R")
[2]: file.path(R.home("share"), "R", "examples-footer.R")
[3]:
https://github.com/r-devel/r-svn/blob/15253534aa1f4e91d33d9b0e3f035daedfe750bb/src/library/grDevices/man/unix/png.Rd#L249-L259

BTW, on Unix-alikes, example(png) writes to files myplot.png,
myplot1.jpeg, and myplot2.jpeg in the current working directory. This
should be fixed.



Am 22.07.20 um 19:25 schrieb Helmut Schütz:
> Hi Serguei,
> 
> Serguei Sokol wrote on 2020-07-22 15:51:
>> Hmm... I see 2 possibilities for still getting an error while the
>> concerned part of code is not supposed to be run:
>>
>>  - either you are running not updated version of your package;
> 
> I _can_ built the package and it runs as intended. Only the CHECK throws
> the error.
> 
>>  - or the error comes from some other place of the code.
> 
> Closing the device is required only _once_ in the entire package.
> In my NAMESPACE I have (and had in all previous versions):
> importFrom(grDevices, png, graphics.off, dev.list, dev.off)
> 
>> Sorry but without a minimal reproducible example I cannot help more.
> 
> The problem is that I cannot reproduce it as well. Only CHECK laments
> about dev.off() which I changed to graphics.off() in the meantime.
> 
> library(grDevices)
> foo <- TRUE   # shall we plot?
> png.path <- "~/" # user's home folder
> png.path <- normalizePath(png.path)
> if (foo) {
>   png(paste0(png.path, "test.png"), width = 480, height = 480, pointsize
> = 12)
> }
> plot(x = 0:1, y = 0:1, type = "l", xlab = "x", ylab = "y")
> if (foo) {
>   graphics.off()
> }
> 
> Best,
> Helmut
>

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


Re: [R-pkg-devel] Error in CHECK caused by dev.off()

2020-07-23 Thread Dirk Eddelbuettel


Helmut,

For previous uploads you affirmed that you read the CRAN Repository Policy
which states

 * The code and examples provided in a package should never do anything
   which might be regarded as malicious or anti-social. The following are
   illustrative examples from past experience.

   [...]

  * - 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). Installing into the system’s R
installation (e.g., scripts to its bin directory) is not allowed.

Your package appears to violate that requirement. I would fix the package.

Dirk

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

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


Re: [R-pkg-devel] Error in CHECK caused by dev.off()

2020-07-23 Thread Duncan Murdoch

On 23/07/2020 8:18 a.m., Helmut Schütz wrote:

Hi David,

David Cortes wrote on 2020-07-23 13:16:

It is explained here:
https://cran.r-project.org/web/packages/policies.html
Section about source packages:
"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)."


THX; I missed that! However, the policy continues:
"Limited exceptions may be allowed in interactive sessions if the
package obtains confirmation from the user."
IMHO, this is applicable here (i.e., the user _should_ specify a
directory (as recommended in the man-pages), and only if none is
provided, a warning is issued and confirmation obtained).
If I would use tempdir() and the user forgets to copy the result files
to another location and closes the console, everything would be lost and
the user would have to start again from scratch. I think that this is
not very user-friendly.


I would issue an error instead of a warning, and in the error message, 
suggest some code that should work.


Duncan Murdoch

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


Re: [R-pkg-devel] Error in CHECK caused by dev.off()

2020-07-23 Thread Helmut Schütz

Hi David,

David Cortes wrote on 2020-07-23 13:16:

It is explained here:
https://cran.r-project.org/web/packages/policies.html
Section about source packages:
"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)."


THX; I missed that! However, the policy continues:
"Limited exceptions may be allowed in interactive sessions if the 
package obtains confirmation from the user."
IMHO, this is applicable here (i.e., the user _should_ specify a 
directory (as recommended in the man-pages), and only if none is 
provided, a warning is issued and confirmation obtained).
If I would use tempdir() and the user forgets to copy the result files 
to another location and closes the console, everything would be lost and 
the user would have to start again from scratch. I think that this is 
not very user-friendly.


Helmut

--
Ing. Helmut Schütz
BEBAC – Consultancy Services for
Bioequivalence and Bioavailability Studies
Neubaugasse 36/11
1070 Vienna, Austria
E helmut.schu...@bebac.at
W https://bebac.at/
F https://forum.bebac.at/

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


Re: [R-pkg-devel] Error in CHECK caused by dev.off()

2020-07-23 Thread David Cortes
It is explained here:
https://cran.r-project.org/web/packages/policies.html
Section about source packages:
"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)."

And I think the policy was different at some point in the past. Anyway,
it's a good policy - just get a temporary folder and your desired file
name - e.g.:
file.path(tempdir(), "your_file.png")

Best regards,
David Cortes

On Thu, 2020-07-23 at 12:44 +0200, Helmut Schütz wrote:
> Dear Duncan,
> 
> Duncan Murdoch wrote on 2020-07-22 23:48:
> > On 22/07/2020 5:40 p.m., Helmut Schütz wrote:
> > > 
> > > Duncan Murdoch wrote on 2020-07-22 21:42:
> > > 
> > > > During a check, it probably wouldn't, because you aren't
> > > > allowed to 
> > > > write to "~/".  Your package should be writing to tempdir(), or
> > > > a 
> > > > location entered by the user.
> > > 
> > > The user is asked to provide a certain path indeed. Only if none
> > > is 
> > > provided, the fallback is "~/" (which is always writable). 
> > 
> > That disqualifies your package from inclusion on CRAN.
> 
> Can you please point to such a policy in the R-Extension Manual?
> Eight 
> versions of the package were accepted by CRAN and three times checked
> by 
> members of the team.
> 
> BTW, the package passed on winbuilder:
> Your package replicateBE_1.0.14.9000.tar.gz has been built (if
> working) 
> and checked for Windows.
> Please check the log files and (if working) the binary package at:
> https://win-builder.r-project.org/k2tGfNoY7y88
> The files will be removed after roughly 72 hours.
> Installation time in seconds: 41
> Check time in seconds: 251
> Status: 1 NOTE
> R version 4.0.2 (2020-06-22)
> Hence, I suspect that there is a problem with CHECK which I run
> locally 
> on my machine.
> 
> > If no destination is provided and tempdir() isn't acceptable, you 
> > shouldn't write anything.  The user may be keeping an
> > irreplaceable 
> > piece of information in "~/test.png", and your package would
> > destroy 
> > it.  It's not your decision to make to trespass on the user's file
> > space.
> 
> The package is used in a regulated environment (e.g., for the FDA).
> The 
> name of the file is always unique, i.e., depends on the input. The
> code 
> checks whether a file with the same name already exist and -- if yes
> -- 
> asks the user to confirm overwriting it.
> The man-pages make clear that a path should be provided. If none is 
> provided, a message is issued informing the user that results are
> saved 
> in the home directory. By using tempdir() the user would have to
> move 
> all files to another location before the session is closed.
> 
> Helmut
>

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


Re: [R-pkg-devel] Error in CHECK caused by dev.off()

2020-07-23 Thread Helmut Schütz

Dear Duncan,

Duncan Murdoch wrote on 2020-07-22 23:48:

On 22/07/2020 5:40 p.m., Helmut Schütz wrote:



Duncan Murdoch wrote on 2020-07-22 21:42:

During a check, it probably wouldn't, because you aren't allowed to 
write to "~/".  Your package should be writing to tempdir(), or a 
location entered by the user.


The user is asked to provide a certain path indeed. Only if none is 
provided, the fallback is "~/" (which is always writable). 


That disqualifies your package from inclusion on CRAN.


Can you please point to such a policy in the R-Extension Manual? Eight 
versions of the package were accepted by CRAN and three times checked by 
members of the team.


BTW, the package passed on winbuilder:
Your package replicateBE_1.0.14.9000.tar.gz has been built (if working) 
and checked for Windows.

Please check the log files and (if working) the binary package at:
https://win-builder.r-project.org/k2tGfNoY7y88
The files will be removed after roughly 72 hours.
Installation time in seconds: 41
Check time in seconds: 251
Status: 1 NOTE
R version 4.0.2 (2020-06-22)
Hence, I suspect that there is a problem with CHECK which I run locally 
on my machine.


If no destination is provided and tempdir() isn't acceptable, you 
shouldn't write anything.  The user may be keeping an irreplaceable 
piece of information in "~/test.png", and your package would destroy 
it.  It's not your decision to make to trespass on the user's file space.


The package is used in a regulated environment (e.g., for the FDA). The 
name of the file is always unique, i.e., depends on the input. The code 
checks whether a file with the same name already exist and -- if yes -- 
asks the user to confirm overwriting it.
The man-pages make clear that a path should be provided. If none is 
provided, a message is issued informing the user that results are saved 
in the home directory. By using tempdir() the user would have to move 
all files to another location before the session is closed.


Helmut

--
Ing. Helmut Schütz
BEBAC – Consultancy Services for
Bioequivalence and Bioavailability Studies
Neubaugasse 36/11
1070 Vienna, Austria
E helmut.schu...@bebac.at
W https://bebac.at/
F https://forum.bebac.at/

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