Re: [Rd] New pipe operator

2020-12-05 Thread John Mount
The :: is a case that we worked to get right with wrapr dot-pipe. I shared notes on this S3/S4 pipe in the R journal https://journal.r-project.org/archive/2018/RJ-2018-042/index.html library(magrittr) packageVersion("magrittr") # [1] ‘2.0.1’ 5 %>% base::sin # Error in .::base : unused argument (

[Rd] I would suggest stats::glm() should set "converged" to FALSE in the return value in a few more situations.

2020-08-16 Thread John Mount
I would suggest stats::glm() should set "converged" to FALSE in the return value in a few more situations. I believe the current returned converged == TRUE can be needlessly misleading when the algorithm has clearly failed (and the algo even issued a warning, but the returned structure claims al

Re: [Rd] lm() takes weights from formula environment

2020-08-10 Thread John Mount
Forgot the url: https://win-vector.com/2014/05/30/trimming-the-fat-from-glm-models-in-r/ On Aug 10, 2020, at 11:50 AM, John Mount mailto:jmo...@win-vector.com>> wrote: Thank you for your suggestion. I do know how to work around the issue. I usually build a fresh environment as a ch

Re: [Rd] lm() takes weights from formula environment

2020-08-10 Thread John Mount
ents other than global/base (such as those formed when building a formula in a function) capturing references to unrelated structures. > On Aug 10, 2020, at 11:34 AM, Duncan Murdoch wrote: > > On 10/08/2020 1:42 p.m., John Mount wrote: >> I wish I had started with "I am disappoi

Re: [Rd] lm() takes weights from formula environment

2020-08-10 Thread John Mount
I wish I had started with "I am disappointed that lm() doesn't continue its search for weights into the calling environment" or "the fact that lm() looks only in the formula environment and data frame for weights doesn't seem consistent with how other values are treated." But I did not. So I do

Re: [Rd] lm() takes weights from formula environment

2020-08-09 Thread John Mount
is guaranteed > to be found even if there's a conflicting variable in the formula > environment, or the global environment. > > Duncan Murdoch > > On 09/08/2020 2:13 p.m., John Mount wrote: >> I know this programmers can reason this out from R's late parameter &g

[Rd] lm() takes weights from formula environment

2020-08-09 Thread John Mount
I know this programmers can reason this out from R's late parameter evaluation rules PLUS the explicit match.call()/eval() lm() does to work with the passed in formula and data frame. But, from a statistical user point of view this seems to be counter-productive. At best it works as if the user

Re: [Rd] Request: tools::md5sum should accept connections and finally in-memory objects

2020-05-01 Thread John Mount
> So yes, if one wants to use all the utilities or the various algos that the > digest package provides, one should install and load it. But if one can live > with MD5 hashes, why not use the built-in R function? (Well, without > serializing an object to a file, calling tools::md5sum, and then

Re: [Rd] Request: tools::md5sum should accept connections and finally in-memory objects

2020-05-01 Thread John Mount
rds, > Denes > > > [1]: https://github.com/HenrikBengtsson/Wishlist-for-R/issues/21 > [2]: > https://github.com/wch/r-source/blob/5a156a0865362bb8381dcd69ac335f5174a4f60c/src/library/tools/src/md5.c#L172 > [3]: > https://github.com/wch/r-source/blob/5a156a0865362bb8381dcd69ac3

Re: [Rd] A bug understanding F relative to FALSE?

2020-01-17 Thread John Mount
t; > Iago > > > [[alternative HTML version deleted]] > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel --- John Mount http://www.win-vector.com/ <http://www.wi

Re: [Rd] [R] choose(n, k) as n approaches k

2020-01-14 Thread John Mount
>>>>>>> choose(4.001, 4) >>>>>> [1] 4 >>>>>>> choose(4.01, 4) >>>>>> [1] 1.000002 >>>>>> >>>>>> Should base::choose(n, k) check whether n is within machine precision of >>>>>> k and re

Re: [Rd] should base R have a piping operator ?

2019-10-06 Thread John Mount
Except for the isolation of local() R pretty much already has the parsing transformation you mention. as.list(parse(text=" iris ->.; group_by(., Species) ->.; summarize(., mean_sl = mean(Sepal.Length)) ->.; filter(., mean_sl > 5) ")) #> [[1]] #> . <- iris #> #> [[2]] #> . <- group_by

Re: [Rd] should base R have a piping operator ?

2019-10-05 Thread John Mount
t; Error: C stack usage 15923776 is too close to the limit > > What I propose on the other hand can always substitute any existing proper > pipe in their standard feature, as long as the dot is made explicit. > > Best regards, > > Antoine > > > > L

Re: [Rd] should base R have a piping operator ?

2019-10-05 Thread John Mount
t; f1 <- function(y) function() eval(quote(y)) > f2 <- x %.% f1(.) > f2() > #> [1] "a" > ``` > > Looking forward for your thoughts on this, > > Antoine > > [[alternative HTML version deleted]] > > __ > R-devel@r-p

Re: [Rd] Use of C++ in Packages

2019-04-24 Thread John Mount
/github.com/JuliaLang/julia/issues/28606 >> [2]: https://doi.org/10.1201/9781315381305 >> [3]: http://www.lua.org/manual/5.1/manual.html#lua_pcall >> [4]: http://www.lua.org/manual/5.1/manual.html#lua_cpcall >> >> __ >

[Rd] Red: RFC: (in-principle) native unquoting for standard evaluation

2017-03-18 Thread John Mount
want this chaining; and there are issues of quoting it out) in eval would be very valuable. Obviously it is most useful where non-standard evaluation is emphasized (plotting, formulas, and dplyr being the examples that I can immediately think of). --- John Mount http://www.win

Re: [Rd] summary.default rounding on numeric seems inconsistent with other R behaviors

2016-08-24 Thread John Mount
> Martin > That is potentially a very good outcome. Thank you so much for producing and testing a patch. --- John Mount http://www.win-vector.com/ <http://www.win-vector.com/> Our book: Practical Data Science with R http://www.manning

[Rd] summary.default rounding on numeric seems inconsistent with other R behaviors

2016-08-19 Thread John Mount
the pain point here http://www.win-vector.com/blog/2016/08/my-criticism-of-r-numeric-summary/ <http://www.win-vector.com/blog/2016/08/my-criticism-of-r-numeric-summary/> (I am not trying to be rude, more I am trying to emphasize why this can be confusing to new users). ---