Re: [Rd] Base R examples that write to current working directory

2018-04-04 Thread Gabe Becker
Martin et al, I have submitted a patch on bugzilla which fixes all of the examples I could easily find which were not already writing only to temporary files or switching to a temp directory before writing files to the working directory. https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17403 P

Re: [Rd] Part of fastpass in 'sort.list' can make sorting unstable

2018-04-06 Thread Gabe Becker
Thanks for catching this. This is easy to take out without touching the rest of the machinery. It also wouldn't be too hard to write a still-faster-but-not-quite-as-much-path which correctly reverses the sortedness of a sorted vector that includes ties. My suspicion, without being the one who will

Re: [Rd] mean(x) for ALTREP

2018-04-26 Thread Gabe Becker
Serguei, The R 3.5.0 release includes the fundamental ALTREP framework but does not include many 'hooks' within R's source code to make use of methods on the ALTREP custom vector classes. I have implemented a fair number, including for mean() to use the custom Sum method when available, in the ALT

Re: [Rd] debugonce() functions are not considered as debugged

2018-05-01 Thread Gabe Becker
Gabor, Others can speak to the origins of this more directly, but from what I recall this has been true at least since I was working in this space on the debugcall stuff a couple years ago. I imagine the reasoning is what you would expect: a single bit of course can't tell R both that a function

Re: [Rd] length of `...`

2018-05-03 Thread Gabe Becker
As of 3.5.0 the ...length() function does exactly what you are asking for. Before that, I don't know of an easy way to get the length without evaluation via R code. There may be one I'm not thinking of though, I haven't needed to do this myself. Hope that helps. ~G On Thu, May 3, 2018 at 7:52 AM

Re: [Rd] Debugging "SETLENGTH() cannot be applied to an ALTVEC object."?

2018-05-04 Thread Gabe Becker
Tal, I don't have a debian machine at my fingertips, but I don't see that error when installing heatmaply into a clean library in R 3.5.0 (that takes a while...). I suspect you're hitting old installed versions of packages in that build on that machine, especially since the failure is not univers

Re: [Rd] download.file does not process gz files correctly (truncates them?)

2018-05-07 Thread Gabe Becker
Hey all, I don't have a strong opinion about whether the default should ultimately eventually change or not. Many people who use windows (a set which does not include me) seem to think it would be better. I will say that like Hugh, I'm strongly against making the argument mandatory as an interim

Re: [Rd] Proposed speedup of ifelse

2018-05-07 Thread Gabe Becker
Hugh, (Note I speak for myself only and not for R-core) Thanks for looking into this. I think it's great to have community members that are interested in contributing to R and helping it continue to get better. And I think, and my local experiments bear out, that using anyNA as a fastpass conditi

Re: [Rd] Date class shows Inf as NA; this confuses the use of is.na()

2018-06-11 Thread Gabe Becker
Emil et al., On Mon, Jun 11, 2018 at 1:08 AM, Emil Bode wrote: > I don't think there's much wrong with is.na(as_date(Inf, > origin='1970-01-01'))==FALSE, as there still is some "non-NA-ness" about > the value (as difftime shows), but that the output when printing is > confusing. The way cat is

Re: [Rd] Date class shows Inf as NA; this confuses the use of is.na()

2018-06-13 Thread Gabe Becker
Greg, I see what you mean, but on the other hand, that's not how we think about real numbers working either, and doubles have that behavior generally. It might be possible to put checks in (with a potentially non-trivial overhead cost) to disallow that kind of thing, but again R (and everyone else

Re: [Rd] Bug in tools::md5sum - does not work when filepath contains tilde (ie home directory)

2018-06-29 Thread Gabe Becker
Dean, I filed a patch for this in bugzilla yesterday so depending on reception this should be fixed in devel soon. Best, ~G On Fri, Jun 29, 2018, 3:58 AM Dean Attali wrote: > I've reproduced on ubuntu and winodws with R3.4.3 > > When the filepath contains a tilde, the result is NA. But if the

Re: [Rd] Parametrized Vignettest in R packages

2018-07-02 Thread Gabe Becker
Witold, Vignettes, in the package sense, are and must be entirely self-contained as far as I know. They are run automatically in completely clean R sessions. I'm not sure a parameterized vignette makes a ton of sense within that context. Can you explain what you would want to have happen when the

Re: [Rd] Testing for vectors

2018-07-07 Thread Gabe Becker
Hadley, > I was thinking primarily of completing the set of is.matrix() and > is.array(), or generally, how do you say: is `x` a 1d dimensional > thing? > Can you clarify what you mean by dimensionality sense and specifically 1d here? You can have a 1d array which is different from what your pr

Re: [Rd] Testing for vectors

2018-07-07 Thread Gabe Becker
Hadley, On Sat, Jul 7, 2018 at 1:32 PM, Hadley Wickham wrote: > On Sat, Jul 7, 2018 at 1:50 PM, Gabe Becker wrote: > > Hadley, > > > >> > >> I was thinking primarily of completing the set of is.matrix() and > >> is.array(), or generally, how do y

Re: [Rd] vctrs: a type system for the tidyverse

2018-08-06 Thread Gabe Becker
Hadley, Looks interesting and like a fun project from what you said in the email (I don't have time right now to dig deep into the readme) A few thoughts. First off, you are using the word "type" throughout this email; You seem to mean class (judging by your Date and factor examples, and the fact

Re: [Rd] vctrs: a type system for the tidyverse

2018-08-08 Thread Gabe Becker
Hadley, Responses inline. On Wed, Aug 8, 2018 at 7:34 AM, Hadley Wickham wrote: > >>> Method dispatch for `vec_c()` is quite simple because associativity and > >>> commutativity mean that we can determine the output type only by > >>> considering a pair of inputs at a time. To this end, vctrs p

Re: [Rd] vctrs: a type system for the tidyverse

2018-08-08 Thread Gabe Becker
Actually, I sent that too quickly, I should have let it stew a bit more. I've changed my mind about the resolution argument I Was trying to make. There is more information, technically speaking, in the factor with empty levels. I'm still not convinced that its the right behavior, personally. It may

Re: [Rd] conflicted: an alternative conflict resolution strategy

2018-08-24 Thread Gabe Becker
Hadley, Overall seems like a cool and potentially really idea. I do have some thoughts/feedback, which I've put in-line below On Thu, Aug 23, 2018 at 11:31 AM, Hadley Wickham wrote: > > > > conflicted applies a few heuristics to minimise false positives (at the > cost of introducing a few fal

Re: [Rd] Proposal: more accurate seq(from, to, length=n)

2018-09-07 Thread Gabe Becker
Suharto, My 2c inline. On Fri, Sep 7, 2018 at 2:34 PM, Suharto Anggono Suharto Anggono via R-devel wrote: > In R, > seq(0, 1, 0.1) > gives the same result as > (0:10)*0.1. > It is not the same as > c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1) , > as 0.1 is not represented exactly. I am

Re: [Rd] Bias in R's random integers?

2018-09-20 Thread Gabe Becker
Hi all, On Thu, Sep 20, 2018 at 9:30 AM, Paul Gilbert wrote: > > > There are only two small problems that occur to me: > > 1/ Researchers that want to have reproducible results (all I hope) need to > be aware the change has happened. In theory they should have recorded the > RNG they were using,

Re: [Rd] R_ext/Altrep.h should be more C++-friendly

2018-10-09 Thread Gabe Becker
Michael, Thanks for reaching out. This was brought up by Romaine Francois offline to me as well. What he does as a workaround is #define class klass extern "C" { #include } #undef class While we consider changing Altrep.h, the above should work for you in the immediate term. Let me know if

Re: [Rd] methods(class = class()) - improve for |cl.| > 1 ?

2018-10-19 Thread Gabe Becker
Martin and Kevin, Perhaps a variant of methods which more directly addresses the use-case Kevin mentions might be in order? I am happy to prepare a patch which implements a methodsForObj function (name very much negotiable), or a third obj argument to methods which takes the actual object and ans