[Rd] [patch] add sanity checks to quantile()

2019-05-30 Thread Scott Kostyshak
The attached patch adds some sanity checks to the "type" argument of quantile(). Output from the following commands show the change of behavior with the current patch: vec <- 1:10 quantile(vec, type = c(1, 2)) quantile(vec, type = 10) quantile(vec, type = "aaa") quantile(vec, type = NA_r

Re: [Rd] use of buffers in sprintf and snprintf

2019-05-30 Thread Henrik Bengtsson
On Thu, May 30, 2019 at 7:21 PM Simon Urbanek wrote: > > No, that will make it even worse since you'll be declaring a lot more memory > that you actually have. > > The real problem is that you're ignoring the truncation, so you probably want > to use something like > > if (snprintf(tempname, siz

Re: [Rd] use of buffers in sprintf and snprintf

2019-05-30 Thread Simon Urbanek
No, that will make it even worse since you'll be declaring a lot more memory that you actually have. The real problem is that you're ignoring the truncation, so you probably want to use something like if (snprintf(tempname, sizeof(tempname), "%s.%d", of1name, j) >= sizeof(tempname)) Rf_error("

Re: [Rd] R pkg install should fail for unsuccessful DLL copy on windows?

2019-05-30 Thread Pages, Herve
Also note that this can lead to people not being able to load the package if the set of .Call entry points has changed between the old and new versions of the package. We strongly suspect that this is what happened to this Bioconductor user: https://support.bioconductor.org/p/121228/ Note that

Re: [Rd] R pkg install should fail for unsuccessful DLL copy on windows?

2019-05-30 Thread Toby Hocking
thanks for the tip Jan. However it would be nice if I didn't have to handle this myself for all of my packages. (and teach my students how to do that) BTW I tried to disable staged installation, and the issue still happens: th798@cmp2986 MINGW64 ~/projects/max-generalized-auc (master) $ R_INSTAL

Re: [Rd] Converting non-32-bit integers from python to R to use bit64: reticulate

2019-05-30 Thread Juan Telleria Ruiz de Aguirre
Thank you Gabriel for valuable insights on the 64-bit integers topic. In addition, my statement was wrong, as Python3 seems to have unlimited (and variable) size integers. Here is related CPython Code: https://github.com/python/cpython/blob/master/Objects/longobject.c Division between Int-32 and

Re: [Rd] use of buffers in sprintf and snprintf

2019-05-30 Thread jing hua zhao
Hi again, I realised it is useful to replicate the warnings locally without relying on CRAN automatic check; instead of R(-devel) CMD check --as-cran package_version.tar.gz one can use R CMD check --configure-args="" and in my case the WARNINGS were initially given with https://www.stats.ox.

Re: [Rd] stopifnot

2019-05-30 Thread Suharto Anggono Suharto Anggono via R-devel
Here is a patch to function 'stopifnot' that adds 'evaluated' argument and makes 'exprs' argument in 'stopifnot' like 'exprs' argument in 'withAutoprint'. --- stop.R 2019-05-30 14:01:15.282197286 + +++ stop_new.R 2019-05-30 14:01:51.372187466 + @@ -31,7 +31,7 @@ .Internal(s