Re: [Rd] missing `=` in man page for files2

2017-07-22 Thread Duncan Murdoch
and "concepts", which are search terms leading to it. For files2.Rd, they are: \alias{dir.create} \alias{dir.exists} \alias{Sys.chmod} \alias{Sys.umask} \concept{directory} \concept{mkdir} \alias{umask} % for links (Aliases work with ?

Re: [Rd] Why is as.function() slower than eval(call("function"())?

2017-08-04 Thread Duncan Murdoch
.function.default(x, envir)) If I skip the is.function(x) test and call .Internal directly, I find it is about 10% faster than `function`. But that is an extremely risky optimization; it wouldn't be accepted in a CRAN package. Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] strange behaviour read.table and clipboard

2017-08-15 Thread Duncan Murdoch
mfortable saying I did what you did. Please reduce the size of your spreadsheet if you can, and then post instructions for how to construct it, and what to cut and paste from it. Then others can try what you did and see if this is specific to your machine, to that particular version of R-dev

Re: [Rd] Natural vs National in R signon banner?

2017-08-31 Thread Duncan Murdoch
ils dazu. and so on. Please ignore this and forgive me if this is an inappropriate post. I am a N00B in R. I don't think it is inappropriate. Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] R-devel r73293 and the testthat package

2017-09-18 Thread Duncan Murdoch
alled. Otherwise, you'll just need to wait until the new version shows up on your mirror. Duncan Murdoch Will R Under development (unstable) (2017-09-16 r73293) -- "Unsuffered Consequences" Copyright (C) 2017 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw

Re: [Rd] what do you think about write.table(... qmethod = "excel")?

2017-09-19 Thread Duncan Murdoch
that imitate Excel, then why not do what they ask? On the other hand, if they aren't willing to pay for the work, then you should lecture them on how silly their request is. In any case, base R functions should not include nonsense, so this is not something that should go into R. Duncan

Re: [Rd] possible bug in R CMD Rd2pdf

2017-09-27 Thread Duncan Murdoch
or"] } So Peter is right, this would likely work if the current working directory was the top level directory of the package, but it can't work in general. The easiest fix would probably be to change the code underlying R CMD Rd2pdf so that it works from th

Re: [Rd] possible bug in R CMD Rd2pdf

2017-09-27 Thread Duncan Murdoch
could also use R CMD Rd2pdf . while in that directory. Duncan Murdoch The fact that the output starts by Hmm ... looks like a package threw me off. That output suggests it should work, I think. So I would suggests either   1) handling both package and man directories   2) check that the in

Re: [Rd] Unexpected behaviour with download.packages on Windows

2017-09-29 Thread Duncan Murdoch
kages() interprets "both" as "source". The documentation is unclear about this, but the source is pretty simple. The source to install.packages() is a lot more complicated, but I believe it would normally interpret "both" as "win.binary" on Windows, as

Re: [Rd] How to do a "Box's M" Test with

2017-10-27 Thread Duncan Murdoch
s doesn't make sense. You are pasting an REXP object myDf into a string to evaluate. It would make sense to assign that dataframe object to an R variable, and paste the name of that variable into your expression, or to construct a language object containing the dataframe object, but I don&#

Re: [Rd] Cannot Compute Box's M (Three Days Trying...)

2017-10-27 Thread Duncan Murdoch
Just print the string you are asking to R to evaluate. It doesn't make any sense as an R expression. Fix that, and things will work. Duncan Murdoch On 27/10/2017 3:41 PM, Morkus via R-devel wrote: It can't be this hard, right? I really need a shove in the right direction

Re: [Rd] Cannot Compute Box's M (Three Days Trying...)

2017-10-28 Thread Duncan Murdoch
guess there's something weird about boxMVariable. You should ask R to print it, and to print str(boxMVariable), to make sure it's a regular dataframe containing 4 numeric columns and one factor or character column. Duncan Murdoch From this code: . . . /// assign the data to a varia

Re: [Rd] Cannot Compute Box's M (Three Days Trying...)

2017-10-28 Thread Duncan Murdoch
On 28/10/2017 7:12 AM, Morkus wrote: Thanks Duncan. Awesome ideas! I think we're getting closer! I tried what you suggested and got a possibly better error... . . . rConnection.assign("boxMVariable", myDf); *String resultBV *= *"str(boxMVariable)"*; *// your sugge

Re: [Rd] Cannot Compute Box's M (Three Days Trying...)

2017-10-28 Thread Duncan Murdoch
On 28/10/2017 8:59 AM, Morkus wrote: Hey Duncan, Hard to debug? That's an understatement. Eyes bleeding In any case, I tried all your suggestions. To get "integer" for the final column, I had to change the code to get integers instead of strings. The last column in iri

Re: [Rd] Cannot Compute Box's M (Three Days Trying...)

2017-10-29 Thread Duncan Murdoch
On 29/10/2017 7:26 AM, Morkus wrote: Thanks Duncan. I can't tell you how helpful all your terrific replies have been. I think the biggest surprise is that nobody appears to be using Java and R together like I"m trying to do. I suppose it should be a surprise since there are no bo

Re: [Rd] Extreme bunching of random values from runif with Mersenne-Twister seed

2017-11-05 Thread Duncan Murdoch
ng about this problem is that Tirthankar doesn't believe that the seed selection process is aware of the function output. I would say that it must be, and he should be investigating how that happens if he is worried about the output, he shouldn't be worrying about R's RNG. Duncan Mu

Re: [Rd] Extreme bunching of random values from runif with Mersenne-Twister seed

2017-11-06 Thread Duncan Murdoch
On 05/11/2017 10:58 AM, peter dalgaard wrote: On 5 Nov 2017, at 15:17 , Duncan Murdoch wrote: On 04/11/2017 10:20 PM, Daniel Nordlund wrote: Tirthankar, "random number generators" do not produce random numbers. Any given generator produces a fixed sequence of numbers that appe

Re: [Rd] R CMD check warning about compiler warning flags

2017-12-20 Thread Duncan Murdoch
e the diff between that and 73908 (which is what the github link showed). I also don't know if there's a way to show the diff between commit N and N-1 in github if I only know N. Duncan Murdoch __ R-devel@r-project.org mailing list https://

Re: [Rd] R CMD check warning about compiler warning flags

2017-12-21 Thread Duncan Murdoch
On 20/12/2017 6:52 PM, Duncan Murdoch wrote: On 20/12/2017 5:48 PM, Hadley Wickham wrote: On Wed, Dec 20, 2017 at 4:26 PM, Prof Brian Ripley wrote: On 20/12/2017 17:42, Winston Chang wrote: On recent builds of R-devel, R CMD check gives a WARNING when some compiler warning flags are

Re: [Rd] R CMD check warning about compiler warning flags

2017-12-21 Thread Duncan Murdoch
one could set up (or already has?) one of the web viewers (WebSVN, etc.) for the real repository. That would be better for those of us who are SVN users, but probably harder for Git users. Duncan Murdoch And your description seems wrong: there is now an _optional_ check controlled by an envir

Re: [Rd] R CMD check warning about compiler warning flags

2017-12-25 Thread Duncan Murdoch
On 22/12/2017 10:46 AM, Marc Schwartz wrote: Hi, See inline below. On Dec 22, 2017, at 9:12 AM, Martin Maechler wrote: Duncan Murdoch on Thu, 21 Dec 2017 14:23:13 -0500 writes: On 21/12/2017 1:02 PM, Winston Chang wrote: On recent builds of R-devel, R CMD check gives a WARNING

Re: [Rd] R CMD check warning about compiler warning flags

2017-12-25 Thread Duncan Murdoch
On 25/12/2017 7:00 AM, Iñaki Úcar wrote: 2017-12-25 12:30 GMT+01:00 Duncan Murdoch : The one negative aspect of Winston's effort is caused by this weakness. If you tell me that something happened in revision 73909, I know it was recent. If you tell me that something appeared in commit 2e

Re: [Rd] r-project.org SSL certificate issues

2020-05-30 Thread Duncan Murdoch
e download still fails, presumably because something not shown has expired. Hopefully someone who can actually act on this can figure out what needs doing. Duncan Murdoch On Sat, May 30, 2020 at 5:16 PM Bob Rudis wrote: # A tibble: 13 x 1 site 1 beta.r-project.org 2 bugs.r-p

Re: [Rd] install.packages(): About an option for installing archived versions

2020-06-06 Thread Duncan Murdoch
nstall.packages()` be accepted by R-core? R isn't maintained on Github so a PR wouldn't make sense, but I also doubt the submission of an svn patch would be acted on unless you come up with some strong arguments about why remotes::install_version doesn't work properly and ca

Re: [Rd] Change in package.skeleton behavior from R 3.6.3 to R 4.0.0 ?

2020-06-06 Thread Duncan Murdoch
as intentional: - package.skeleton() now explicitly lists all exports in the ‘NAMESPACE’ file. An earlier version of that message even showed up in the link you posted. Duncan Murdoch Dirk [1] This uses the GitHub mirror rather than svn but the underlyin

Re: [Rd] Change in package.skeleton behavior from R 3.6.3 to R 4.0.0 ?

2020-06-06 Thread Duncan Murdoch
On 06/06/2020 3:44 p.m., Duncan Murdoch wrote: On 06/06/2020 3:06 p.m., Dirk Eddelbuettel wrote: ... [deletions] In short, 4.0.0 no longer exports via 'exportPattern("^[[:alpha:]]+")' rendering the new package created non-functional. Was this intentional, or is this a

Re: [Rd] Change in package.skeleton behavior from R 3.6.3 to R 4.0.0 ?

2020-06-06 Thread Duncan Murdoch
On 06/06/2020 4:14 p.m., Dirk Eddelbuettel wrote: On 6 June 2020 at 15:53, Duncan Murdoch wrote: | This change happened in August, 2019, about 10 months ago. Perhaps this | message asking people to test R-devel is relevant: | | https://stat.ethz.ch/pipermail/r-devel/2020-May/079484.html

Re: [Rd] use of the tcltk package crashes R 4.0.1 for Windows

2020-06-07 Thread Duncan Murdoch
ding 'free' to 'Free'. The same commit made the same kind of change to unix/sys-std.c as well. Duncan Murdoch This has nothing to do with the Windows build or installation. Nothing has changed in the windows build procedure between 4.0.0 and 4.0.1. _

Re: [Rd] Restrict package to load-only access - prevent attempts to attach it

2020-06-23 Thread Duncan Murdoch
some weird way. It's fine if you document that it's intended to be used in some particular way, but why try to prevent me from using it differently? Just tell me to read the docs when problems arise because of my misuse and I ask you for help. Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] R 4.0.1-4.0.2 built with Intel Composer 19.0-19.1.1, error in "make check" on CentOS 7.7

2020-06-24 Thread Duncan Murdoch
ror handling isn't working in your build. Duncan Murdoch On 24/06/2020 2:56 p.m., Ryan Novosielski wrote: Hi there, I initially asked about this on r-help and was told this might be a better venue. I’m not really convinced from reading the posting guide, but I’ll give it a shot. It was also sug

Re: [Rd] `basename` and `dirname` change the encoding to "UTF-8"

2020-06-29 Thread Duncan Murdoch
, while asking dirname() and basename() to preserve the encoding sounds reasonable, it seems like it would just be covering up a deeper problem. Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Strange behaviour of methods::slot() when returning a tibble

2020-07-10 Thread Duncan Murdoch
I don't get any warning (but am using slightly different versions of everything than you are). You can find where that message is coming from by running options(warn=2) first, which will convert it to an error. Duncan Murdoch On 10/07/2020 11:54 a.m., Stephen Martin Pederson wrote: I

Re: [Rd] Speed-up/Cache loadNamespace()

2020-07-19 Thread Duncan Murdoch
nk that would take a really substantial amount of time. One thing you could do is to create a library on a faster drive, and install the minimal set of packages there. Then if that library comes first in .libPaths(), you'll never hit the slow networ

Re: [Rd] Invisible names problem

2020-07-22 Thread Duncan Murdoch
ntributed low level packages. The stringfish package has a "materialize" function that is advertised to convert anything to standard format, but it doesn't change x2. Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Guidelines when to use LF vs CRLF ("\n" vs. "\r\n") on Windows for new lines (line endings)?

2020-07-25 Thread Duncan Murdoch
n on text files, so you rarely need an explicit \r\n. That's the difference between type text and type binary on connections. Duncan Murdoch Best regards Jürgen PS: Examples from base R: R seems to use (almost) only "\n" for new lines internally - even on Windows platfor

Re: [Rd] Seeding non-R RNG with numbers from R's RNG stream

2020-07-30 Thread Duncan Murdoch
to use it? Maybe. Duncan Murdoch On 30/07/2020 3:05 p.m., Tommy Jones wrote: Hi, I am constructing a function that does sampling in C++ using a non-R RNG stream for thread safety reasons. This C++ function is wrapped by an R function, which is user facing. The R wrapper does some sampling

Re: [Rd] Seeding non-R RNG with numbers from R's RNG stream

2020-07-30 Thread Duncan Murdoch
n't a problem! The practical issue is that by effectively inventing your own algorithm, you can't rely on the accumulated experience of everyone else to know whether the generator is good. Duncan Murdoch On Thu, Jul 30, 2020 at 3:36 PM Duncan Murdoch <mailto:murdoch.dun...

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

2020-08-09 Thread Duncan Murdoch
ork around this search order, I think the obvious way is to add your w vector to your d dataframe. That way it 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 wrot

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

2020-08-09 Thread Duncan Murdoch
On 09/08/2020 3:01 p.m., John Mount wrote: Doesn't this preclude "y ~ ." style notations? Yes, but you can use "y ~ . - w". Duncan Murdoch On Aug 9, 2020, at 11:56 AM, Duncan Murdoch wrote: This is fairly clearly documented in ?lm: "All of weights, subs

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

2020-08-09 Thread Duncan Murdoch
On 09/08/2020 3:07 p.m., Duncan Murdoch wrote: On 09/08/2020 3:01 p.m., John Mount wrote: Doesn't this preclude "y ~ ." style notations? Yes, but you can use "y ~ . - w". And as was pointed out to me offline, often one doesn't have a simple vector w giving the

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

2020-08-10 Thread Duncan Murdoch
pt in data, in which case emptyenv() would make more sense (but I haven't tried it, so it might break something). Duncan Murdoch But I did not. So I do apologize for both that and for negative tone on my part. Simplified example: d <- data.frame(x = 1:3, y = c(1, 2, 1)) w <- c(1, 10,

[Rd] Errors when base package version is specified

2020-08-14 Thread Duncan Murdoch
rs would have been less confusing. Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Stale link from ?check to R Internals

2020-08-19 Thread Duncan Murdoch
broken links in the future). Just to be clear: you're giving the current URL, the problem is it's called "Chapter 6". Duncan Murdoch Index: src/library/utils/man/PkgUtils.Rd === --- src/library/utils/man/P

Re: [Rd] R 4.0.2 64-bit Windows hangs

2020-08-21 Thread Duncan Murdoch
CRAN distribution of R. Duncan Murdoch On 21/08/2020 12:53 p.m., m15g9g+1dq20lw4vyh1s--- via R-devel wrote: Thanks for the response. Having spent a lot of the day trying to solve this, as R is essential for my workflow, I've tried to debug via the binary only as I haven't yet got the

[Rd] Error in ?lowess

2020-09-06 Thread Duncan Murdoch
The lowess() help page refers to documentation in "src/appl/lowess.doc". This was moved to "src/library/stats/src/lowess.doc" in 2007. This patch fixes it: Index: src/library/stats/man/lowess.Rd === --- src/library/stats/man/lowe

Re: [Rd] New URL redirect checks

2020-09-16 Thread Duncan Murdoch
t in MacOS) doesn't show the full URL when you hover over the link, as most browsers do. So one could have \href{https://disney.org}{https://horrible.web.site} Duncan Murdoch Cheers, Simon On Sep 17, 2020, at 5:35 AM, Gábor Csárdi wrote: Dear all, the new CRAN URL checks flag HTT

Re: [Rd] Issue with data() function

2020-10-24 Thread Duncan Murdoch
round this constraint? Maybe the solution is to put your datasets into the "datasets" package, or make "survivaldata" a recommended package, or just leave things as they are and ignore the warnings about package size. I think that's a negotiation you should have wit

Re: [Rd] Issue with data() function

2020-10-24 Thread Duncan Murdoch
On 24/10/2020 2:00 p.m., Dirk Eddelbuettel wrote: On 24 October 2020 at 05:28, Duncan Murdoch wrote: | they are and ignore the warnings about package size. I think that's a | negotiation you should have with R Core. s/R Core/CRAN/ ? Yes, for that part. The other suggestions need R

Re: [Rd] vignettes present in 2 folders or won't work

2020-11-01 Thread Duncan Murdoch
of your code) is probably irrelevant to your problem with vignettes, but things like your .Rbuildignore file are not. Duncan Murdoch On 01/11/2020 11:22 a.m., Alexandre Courtiol wrote: Dear all, I am struggling with an issue related to static vignettes: they work, but only when present in

Re: [Rd] vignettes present in 2 folders or won't work

2020-11-01 Thread Duncan Murdoch
On 01/11/2020 1:02 p.m., Alexandre Courtiol wrote: Noted Duncan and TRUE... I cannot do more immediately unfortunately, that is always the issue of asking a last minute panic attack question before teaching a course involving the package... I do have /doc in my .Rbuildignore for reasons I can

Re: [Rd] vignettes present in 2 folders or won't work

2020-11-01 Thread Duncan Murdoch
N or other users to run it, because it's too time-consuming, or needs obscure resources. The CRAN policy discusses this. Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] vignettes present in 2 folders or won't work

2020-11-02 Thread Duncan Murdoch
On 02/11/2020 4:07 a.m., Mark van der Loo wrote: On Sun, Nov 1, 2020 at 10:39 PM Duncan Murdoch <mailto:murdoch.dun...@gmail.com>> wrote: On 01/11/2020 2:57 p.m., Dirk Eddelbuettel wrote: > > The closest to a canonical reference for a static vignette is the

[Rd] Named class vector

2020-11-05 Thread Duncan Murdoch
or? (As far as I can see they are, but maybe I've missed something.) - Is it a good idea to encode a string value worth of information in the name, rather than setting the class to something like c("noquote", "right") instead? Comments would be welcome. Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Process to Incorporate Functions from {parallely} into base R's {parallel} package

2020-11-06 Thread Duncan Murdoch
. There are lots of good packages, and their maintainers should continue to maintain them. Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Process to Incorporate Functions from {parallely} into base R's {parallel} package

2020-11-07 Thread Duncan Murdoch
If these are easy changes, maybe someone will incorporate them. You'll make the argument stronger for doing that if you can explain why it's better to do that than to keep them in parallely. Duncan Murdoch On 07/11/2020 1:39 p.m., Henrik Bengtsson wrote: FWIW, there are indeed

[Rd] Bug in R-devel R CMD check --as-cran (was: [R-pkg-devel] Strange error from CRAN on package submission)

2020-11-12 Thread Duncan Murdoch
ly old code, so I'm not sure what change triggered the error. I suppose I could bisect commits to find it, but not today. Duncan Murdoch On 11/11/2020 8:44 a.m., Kevin R. Coombes wrote: Hi, I am trying to figure out how to fix warnings from two of the CRAN machines on the submission o

Re: [Rd] return (x+1) * 1000

2020-11-20 Thread Duncan Murdoch
It's quite recent (August of this year): see https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17180. Duncan Murdoch /Henrik On Fri, Nov 20, 2020, 13:58 Gabriel Becker wrote: Hi all, I can confirm this occurs for me as well. The one thing that comes to mind is that there are cert

Re: [Rd] return (x+1) * 1000

2020-11-20 Thread Duncan Murdoch
The fact that Python is different is something that's always going to cause problems for people who are more familiar with Python. I don't know Python well enough to list all the gotchas, but I'm sure there are lots of them. Duncan Murdoch Mateo. -- Mateo Obregón. On Friday,

Re: [Rd] return (x+1) * 1000

2020-11-20 Thread Duncan Murdoch
<- function() 3 f <- function() return() f() which will return 3. Duncan Murdoch Mateo. -- Mateo Obregón. On Friday, 20 November 2020 22:52:58 GMT Duncan Murdoch wrote: On 20/11/2020 5:36 p.m., Mateo Obregón wrote: I'm not thinking of complicated cases. This happened to me in a fu

Re: [Rd] return (x+1) * 1000

2020-11-20 Thread Duncan Murdoch
ote in step 1 to the QA tools in the utils package/CRAN checks. That was done this year. Duncan Murdoch On Fri, Nov 20, 2020 at 6:58 PM Henrik Bengtsson wrote: Without having dug into the details, it could be that one could update the parser by making a 'return' a keyword an

Re: [Rd] .Internal(quit(...)): system call failed: Cannot allocate memory

2020-11-21 Thread Duncan Murdoch
available. (I think code can prevent gc; maybe your code is doing that and not re-enabling it?) Having a reproducible example would help, but I imagine it's not easy to put one together. Duncan Murdoch __ R-devel@r-project.org mailing list

Re: [Rd] all.equal applied to function closures

2020-11-30 Thread Duncan Murdoch
ent(environment(target), environment(current), ...) if (is.character(msg)) msg <- paste("Environments:", msg) } return(msg) } if (is.language(target)) return(all.equal.language(target, current, .

Re: [Rd] all.equal applied to function closures

2020-12-01 Thread Duncan Murdoch
open.account example in the R-intro manual would distinguish between ross and robert even if the balances matched. Duncan Murdoch On 01/12/2020 10:37 a.m., Bill Dunlap wrote: Probably all.equal.environment's do1() could be enhanced to do the recursion (and look at the environments' attri

[Rd] New pipe operator

2020-12-04 Thread Duncan Murdoch
t are somewhat confusing: > mtcars |> magrittr::debug_pipe |> head Error: function '::' not supported in RHS call of a pipe but mtcars |> magrittr::debug_pipe() |> head() works. Overall, I think this is a great addition, though it's going to be disruptive for a whi

Re: [Rd] New pipe operator

2020-12-04 Thread Duncan Murdoch
other versions: but that makes it quite a bit more complicated. (Maybe _ or \. should be used instead of ., since those are not legal variable names.) I don't think there should be an attempt to copy magrittr's special casing of how . is used in determining whether to also include t

Re: [Rd] New pipe operator

2020-12-04 Thread Duncan Murdoch
On 04/12/2020 12:06 p.m., Deepayan Sarkar wrote: On Fri, Dec 4, 2020 at 7:35 PM Duncan Murdoch wrote: On 04/12/2020 8:13 a.m., Hiroaki Yutani wrote: Error: function '::' not supported in RHS call of a pipe To me, this error looks much more friendly than magrittr's erro

Re: [Rd] [External] Re: New pipe operator

2020-12-04 Thread Duncan Murdoch
On 04/12/2020 2:26 p.m., luke-tier...@uiowa.edu wrote: On Fri, 4 Dec 2020, Dénes Tóth wrote: On 12/4/20 3:05 PM, Duncan Murdoch wrote: ... It's tempting to suggest it should allow something like   mtcars |> subset(cyl == 4) |> lm(mpg ~ disp, data = .) which would be

Re: [Rd] [External] Re: New pipe operator

2020-12-05 Thread Duncan Murdoch
On 04/12/2020 9:11 p.m., luke-tier...@uiowa.edu wrote: On Sat, 5 Dec 2020, Duncan Murdoch wrote: On 04/12/2020 2:26 p.m., luke-tier...@uiowa.edu wrote: On Fri, 4 Dec 2020, Dénes Tóth wrote: On 12/4/20 3:05 PM, Duncan Murdoch wrote: ... It's tempting to suggest it should allow some

Re: [Rd] [External] Re: New pipe operator

2020-12-06 Thread Duncan Murdoch
sense, but hardly gains anything: whereas dropping the anonymous function definition costs quite a bit. Without special-casing anonymous function definitions you'd need to enter mtcars |> (function(x) x)() or mtcars |> (\(x) x)() which are both quite difficult to read. Duncan Mur

Re: [Rd] [External] Re: New pipe operator

2020-12-06 Thread Duncan Murdoch
On 06/12/2020 11:34 a.m., Dénes Tóth wrote: On 12/6/20 4:32 PM, Duncan Murdoch wrote: > On 06/12/2020 9:43 a.m., Dénes Tóth wrote: >> Dear Luke, >> >> In the meantime I checked the R-syntax branch and the docs; they are >> very helpful. I would also li

Re: [Rd] New pipe operator and gg plotz

2020-12-06 Thread Duncan Murdoch
Hadley's answer (#7 here: https://community.rstudio.com/t/why-cant-ggplot2-use/4372) makes it pretty clear that he thinks it would have been nice now if he had made that choice when ggplot2 came out, but it's not worth the effort now to change it. Duncan Murdoch On 06/12/2020 2:34

Re: [Rd] New pipe operator

2020-12-07 Thread Duncan Murdoch
e than the arithmetic operators, so x*y %>% f() is equivalent to x*f(y), not f(x*y) as it should "obviously" be. I believe the new |> operator falls between "| ||" and "~", so x || y |> f() is the same as f(x || y), and x ~ y |> f() is x ~ f(y).

Re: [Rd] New pipe operator

2020-12-07 Thread Duncan Murdoch
le for other calls, but I think it's a justified one. Duncan Murdoch * except those that include that the parser flags as syntactically special. You have to write 3 |> foo() but don't have to write 3 |> (function(x) x + 1)(). I think you should probably be careful what yo

Re: [Rd] New pipe operator

2020-12-07 Thread Duncan Murdoch
t is more like the way "x -> y" is parsed as "y <- x", or "if (x) y" is transformed to `if`(x, y). Duncan Murdoch It would be neater if it was simply so that the class/type of the object on the right hand side decided what should happen. So we could ha

Re: [Rd] [External] Re: New pipe operator

2020-12-07 Thread Duncan Murdoch
's a bad idea. I haven't checked, but I wouldn't be too surprised if "fun" has been used thousands of times in CRAN packages as the name of a function. So x |> fun(y) would mean "fun(x, y)", whereas x |> fun(y) y+1 would mean (function(y) y+1)(x). Duncan

Re: [Rd] New pipe operator

2020-12-07 Thread Duncan Murdoch
On 07/12/2020 12:09 p.m., Peter Dalgaard wrote: On 7 Dec 2020, at 17:35 , Duncan Murdoch wrote: On 07/12/2020 11:18 a.m., peter dalgaard wrote: Hmm, I feel a bit bad coming late to this, but I think I am beginning to side with those who want "... |> head" to work. And yes

Re: [Rd] [External] anonymous functions

2020-12-08 Thread Duncan Murdoch
unction, which could be used internally by lapply and sapply for the same sort of purpose. tidyverse has rlang::as_function, so they could pretty easily add methods for as.function if they wanted to allow people to use their shorthand in *apply functions. Duncan Murdoch __

Re: [Rd] [External] anonymous functions

2020-12-08 Thread Duncan Murdoch
On 08/12/2020 6:21 a.m., Duncan Murdoch wrote: On 07/12/2020 12:26 p.m., luke-tier...@uiowa.edu wrote: I don't disagree in principle, but the reality is users want shortcuts and as a result various packages, in particular tidyverse, have been providing them. Mostly based on formulas, m

Re: [Rd] New pipe operator

2020-12-08 Thread Duncan Murdoch
't need to choose just one from all the proposed replacements for anonymous function syntax, we can try them out and see which ones we like. We might end up with more than one (like we have at least 4 different high level graphics paradigms!), and that's not the end of the world. D

Re: [Rd] the pipe |> and line breaks in pipelines

2020-12-09 Thread Duncan Murdoch
invisibility from the result (which is a design flaw or bonus, depending on your point of view). So I actually wouldn't advise this workaround. Duncan Murdoch On 09/12/2020 12:45 a.m., Timothy Goodman wrote: Hi, I'm a data scientist who routinely uses R in my day-to-day work, for

Re: [Rd] [External] Re: New pipe operator

2020-12-09 Thread Duncan Murdoch
You might be interested in this blog post by Michael Barrowman: https://michaelbarrowman.co.uk/post/the-new-base-pipe/ He does some timing comparisons, and the current R-devel implementations of |> and \() do quite well. Duncan Murdoch On 06/12/2020 4:42 a.m., Jan Gorecki wrote: L

Re: [Rd] New pipe operator

2020-12-09 Thread Duncan Murdoch
m = TRUE), especially since it has the additional risk that users can define their own function called "curry". Duncan Murdoch The problem with only allowing x |> mean and not x |> mean() is with additional arguments. However, this can be solved with a currying function,

Re: [Rd] New pipe operator

2020-12-09 Thread Duncan Murdoch
On 09/12/2020 10:42 a.m., Jan van der Laan wrote: On 09-12-2020 16:20, Duncan Murdoch wrote: On 09/12/2020 9:55 a.m., Jan van der Laan wrote: I think only allowing functions on the right hand side (e.g. only the |> operator and not the |:>) would be enough to handle most cases and

Re: [Rd] New pipe operator and gg plotz

2020-12-09 Thread Duncan Murdoch
Looks like Sergio Oller took your ambitious approach: https://github.com/zeehio/ggpipe. It hasn't been updated since 2017, so there may be some new things in ggplot2 that aren't there yet. Duncan Murdoch On 09/12/2020 2:16 p.m., Greg Snow wrote: Since `+` is already a function w

Re: [Rd] the pipe |> and line breaks in pipelines

2020-12-09 Thread Duncan Murdoch
nly to the |> operator it would be *really* ugly. My strongest objection to it is the one at the top, though. If I have a block of lines sitting in my editor that I just finished executing, with the cursor pointing at the next line, I'd like to know that it didn't matter whether t

Re: [Rd] the pipe |> and line breaks in pipelines

2020-12-09 Thread Duncan Murdoch
irst part of the pipeline -- i.e., selecting full lines, but starting after the opening paren so as not to need to insert a closing paren. I think I don't understand your workflow enough to comment on this. Duncan - Tim On Wed, Dec 9, 2020 at 12:12 PM Duncan Murdoch <mailto:murdoch

Re: [Rd] bug in "all.vars()"

2020-12-15 Thread Duncan Murdoch
formula(m2) gives Sepal.Length ~ poly(Sepal.Width, 2, raw = T) + Petal.Length and all.vars says it returns "a character vector containing all the names which occur in an expression or call." "T" is a name. There are good reasons why "R CMD check" warns about using T when you mean TRUE. Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Small bug in the documentation of `[.data.frame`

2020-12-29 Thread Duncan Murdoch
defaults to FALSE. I think the Rd checks allow you to leave out defaults, but don't allow you to state them incorrectly, so that's probably why it is left as blank in the Usage section, and explained in the Arguments section. Duncan Murdoch sessionInfo() R version 4.0.3 (2020

Re: [Rd] [External] brief update on the pipe operator in R-devel

2021-01-12 Thread Duncan Murdoch
as in formulae -> ->> rightwards assignment <- <<- assignment (right to left) = assignment (right to left) ? help (unary and binary) (Most of this is taken from ?Syntax, but I added the new operators in based on the gram.y file). So A & B => C &

Re: [Rd] R 4.0.4 scheduled for February 15

2021-01-21 Thread Duncan Murdoch
On 21/01/2021 7:51 a.m., Iñaki Ucar wrote: Minor question: wouldn't the new pipe syntax be worth a minor version bump? I don't think I've seen anything to signal that it will end up in 4.0.4. It's intended for 4.1.0, as far as all the signs show. Duncan Murdoch A pack

Re: [Rd] Bug found in cut.Date, solution found

2021-02-05 Thread Duncan Murdoch
If you don't hear something from someone in R Core, you should submit this as a bug report on bugs.r-project.org. (You might not have an account there; if you don't, someone from R Core will have to give you one. Feel free to remind them if nothing happens in a few days!) Duncan M

Re: [Rd] sprintf, check number of parameters

2021-02-22 Thread Duncan Murdoch
This is ugly, but I think it's legal, and it doesn't trigger a warning: output unused parameters as zero-length strings: msnx(T0, mask = '%1$.1f (SD=%2$.1f)%3$.0s%4$.0s') Perhaps an example using %.0s could be included to show how to skip a value. Duncan Murdoch On

Re: [Rd] Possible x11 window manager window aggregation under one icon?

2021-03-22 Thread Duncan Murdoch
all. (This is after searching rgl sources, with the same result.) I'd be happy to add something to rgl if you could point me to an example: it also uses Xlib like R, so once that works I could propose a patch to R. Duncan Murdoch __ R-devel@r-proj

Re: [Rd] Possible x11 window manager window aggregation under one icon?

2021-03-23 Thread Duncan Murdoch
ther R graphics windows in the same group, but I don't see a way for rgl to know the group_leader that R is using (and it's probably not worth adding this to the API to be able to request it). Am I missing an easier solution? Duncan Murdoch I decided to copy the way GVim sets

Re: [Rd] Possible x11 window manager window aggregation under one icon?

2021-03-23 Thread Duncan Murdoch
On 23/03/2021 11:54 a.m., Ivan Krylov wrote: On Tue, 23 Mar 2021 11:41:39 -0400 Duncan Murdoch wrote: It would probably be nice to have rgl windows and other R graphics windows in the same group, but I don't see a way for rgl to know the group_leader that R is using (and it's pr

Re: [Rd] [Solved] Possible x11 window manager window aggregation under one icon?

2021-03-23 Thread Duncan Murdoch
group together (with a bad icon). I think I'll leave the group_leader in place. I'll think about setting an icon, but I don't see it as urgent. Duncan Murdoch On 23/03/2021 1:36 p.m., Dirk Eddelbuettel wrote: It all works now, thanks mostly to some very detailed reading of th

Re: [Rd] [Solved] Possible x11 window manager window aggregation under one icon?

2021-03-25 Thread Duncan Murdoch
s crammed against the bottom of the screen. I think this is negative (the usual reason I create them all is to hope to spot bad changes). So for a reasonable number of windows the change is an improvement: the windows appear grouped. For a very large number of window

Re: [Rd] Surprising behavior when using the reference class with the dollar symbol

2021-03-27 Thread Duncan Murdoch
eger" ))x <- .foo$new(a=1L)## This is OKx$a## This is OK`$`(x, "a")## But this is not OKi <- "a"`$`(x, i)* This is really hard to read. Please post it again, but don't use HTML. Duncan Murdoch For the last line of code I get this error *Error in envRefInfe

Re: [Rd] R check false positive - multiple versions of a dependency

2021-04-24 Thread Duncan Murdoch
you can ignore the note, but I'd suspect multiple listings are more often an error than intentional, and that's what NOTEs are for. There may still be a more serious bug here if one of the limits is ignored; I haven't checked that. Duncan Murdoch On 21/04/2021 6:57 a.m., Dénes

Re: [Rd] Testing R build when using --without-recommended-packages?

2021-05-05 Thread Duncan Murdoch
7; should run w/o rec.packages but further checking not. So, yes, please, you are encouraged to send patches against the R devel trunk to fix such examples and tests. I think it would be useful to issue some kind of warning if tests are skipped. As mentioned earlier, this is impossible i

<    5   6   7   8   9   10   11   12   13   14   >