Re: [Rd] Is ALTREP "non-API"?

2024-04-22 Thread Gabriel Becker
perimental API" or "unstable API"? > They sound better to me. > > Best, > Yutani > > [1]: > https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Parsing-R-code-from-C > > > 2024年4月22日(月) 16:37 Gabriel Becker : > >> Hi Yutani, >> &

Re: [Rd] Is ALTREP "non-API"?

2024-04-22 Thread Gabriel Becker
d by CRAN at the moment doesn't mean CRAN > will keep accepting it. So, I want to clarify the current status of ALTREP. > > Best, > Yutani > > 2024年4月22日(月) 10:17 : > > > Hello, I don't believe it is illegal, as ALTREP "implements an > abstraction > > underne

Re: [Rd] Improving user-friendliness of S4 dispatch failure when mis-naming arguments?

2023-08-10 Thread Gabriel Becker
I just want to add my 2 cents that I think it would be very useful and beneficial to improve S4 to surface that information as well. More information about the way that the dispatch failed would be of great help in situations like the one Michael pointed out. ~G On Thu, Aug 10, 2023 at 9:59 AM

[Rd] Vectorize library() to improve handling of versioned deps [sprint project proposal]

2023-08-07 Thread Gabriel Becker
Hi All, This is a proposal for a project which could be worked on during the R development Sprint at the end of this month; it was requested that we start a discussion here to see what R-core's thoughts on it were before we officially add it to the docket. AFAIK, R officially supports both

Re: [Rd] codetools wrongly complains about lazy evaluation in S4 methods

2023-06-07 Thread Gabriel Becker
The API supported workaround is to call globalVariables, which, essentially, declares the variables without defining them (a distinction R does not usually make). The issue with this approach, of course, is that its a very blunt instrument. It will cause false negatives if you accidentally use

Re: [Rd] range() for Date and POSIXct could respect `finite = TRUE`

2023-05-19 Thread Gabriel Becker
Hi All, I think there may be some possible confusion about what allowsInf would be reporting (or maybe its just me :) ) if we did this. Consider a class "myclass", S3, for starters, with setMethod("allowsInf", "myclass", function(obj) FALSE) Then, what would myclassthing <- structure(1.5,

Re: [Rd] Should '@" now be listed in tools:::.get_internal_S3_generics() ?

2023-04-28 Thread Gabriel Becker
Karolis, It seems likely, without having looked myself, that you could be correct about the issue, but it does seem worth noting that both of the functions you have mentioned are not exported, and thus not part of the API that extension packages are allowed to use and rely on. If retrieving the

Re: [Rd] Autocompletion for the new S3 generic @ method?

2023-04-02 Thread Gabriel Becker
Hi Tomasz, I haven't had a chance to look at your patch yet (also I can't accept it as I'm not on R-core), but patches for consideration should be submitted to bugzilla (https://bugs.r-project.org), not the unofficial github mirror of the the SVN repo. Best, ~G On Sun, Apr 2, 2023 at 6:09 AM

Re: [Rd] write.csv performance improvements?

2023-03-30 Thread Gabriel Becker
Hi Toby et al, On Wed, Mar 29, 2023 at 10:24 PM Toby Hocking wrote: > Dear R-devel, > I did a systematic comparison of write.csv with similar functions, and > observed two asymptotic inefficiencies that could be improved. > > 1. write.csv is quadratic time (N^2) in the number of columns N. >

Re: [Rd] Request: better default R_LIBS_USER

2023-03-23 Thread Gabriel Becker
Small but crucial typo correction: Perhaps this could be put on the list of possible changes for R 5.0, to be > bundled with other as-yet undecided breaking changes, members of R-core > feel the same way. > *if* members of R-core feel the same way. ~G > > Best, > ~G > > >> Cheers. >> >> --

Re: [Rd] Request: better default R_LIBS_USER

2023-03-23 Thread Gabriel Becker
Felipe, Thanks for being interested in making R better. Its great to see engagement from a new "virtual face", so to speak. That said, without speaking for R-core, my experience is that the R-project and R-core team place a very high premium on backwards compatibility. They will make breaking

Re: [Rd] WISH: Optional mechanism preventing var <<- value from assigning non-existing variable

2023-03-19 Thread Gabriel Becker
I have to say <<- is a core debugging tool when assigning into the global environment. I suppose I could use assign but that would be somewhat annoying. That said I'm still for this change, the vast overwhelming number of times that <<- is in my package code - already rare but it does happen - it

Re: [Rd] Multiple Assignment built into the R Interpreter?

2023-03-11 Thread Gabriel Becker
There are some other considerations too (apologies if these were mentioned above and I missed them). Also below are initial thoughts, so apologies for any mistakes or oversights. For example, if [a, b] <- my2valuefun() works the same as local({ tmp <- my2valuefun() stopifnot(is.list(tmp) &&

Re: [Rd] transform.data.frame() ignores unnamed arguments when no named argument is provided

2023-03-04 Thread Gabriel Becker
~G > > -Original Message- > From: R-devel On Behalf Of Martin Maechler > Sent: Friday, March 3, 2023 10:26 AM > To: Gabriel Becker > Cc: Antoine Fabri ; R-devel < > r-devel@r-project.org> > Subject: Re: [Rd] transform.data.frame() ignores unnamed arguments w

Re: [Rd] transform.data.frame() ignores unnamed arguments when no named argument is provided

2023-03-02 Thread Gabriel Becker
On Thu, Mar 2, 2023 at 2:02 PM Antoine Fabri wrote: > Thanks and good point about unspecified behavior. The way it behaves now > (when it doesn't ignore) is more consistent with data.frame() though so I > prefer that to a "warn and ignore" behaviour: > > data.frame(a = 1, b = 2, 3) > > #> a b

[Rd] nightly r-devel.pkg builds failing since Jan 15

2023-02-26 Thread Gabriel Becker
Hi all, It looks like for intel macs (ie high sierra) the nightly build of R-devel has been failing continuously since Jan 16th: https://mac.r-project.org/high-sierra/last-success/ Is this a known issue? I didn't see any way to get at the relevant logs (of the .pkg creation step), as the

Re: [Rd] unlist preserve common class?

2022-12-09 Thread Gabriel Becker
Best, ~G On Thu, Dec 8, 2022 at 8:21 PM Spencer Graves < spencer.gra...@effectivedefense.org> wrote: > Hi, Gabriel: > > > On 12/8/22 8:20 PM, Gabriel Becker wrote: > > Hi Spencer, > > > > My 2c. > > > > According to the docs, factors are special-cased

Re: [Rd] unlist preserve common class?

2022-12-08 Thread Gabriel Becker
Hi Spencer, My 2c. According to the docs, factors are special-cased. Other S3 'classes' could be special-cased, such as Date in your example, I suppose, but it is not clear how what you're describing could be implemented for the general case. Suppose I define an S3 "class" called

Re: [Rd] tools:: extracting pkg dependencies from DCF

2022-10-28 Thread Gabriel Becker
n into unexported functions. So if you *really* only want to exclude base functions (which likely will give you some protection from versioned dep issues), you can change the code above to needed_pkgs <- setdiff(package_dependencies(...), installed.packages(priority = "high")[,"Pa

Re: [Rd] Lazy-evaluate elements wrapped with invisible

2022-10-28 Thread Gabriel Becker
Hi Dipterix, On Fri, Oct 28, 2022 at 1:10 PM Dipterix Wang wrote: > Hi, > > I was wondering if it is a good idea to delay the evaluation of expression > within invisible(), just like data()/delayedAssign()? > > The idea is a function might return an invisible object. This object might > not be

Re: [Rd] tools:: extracting pkg dependencies from DCF

2022-10-28 Thread Gabriel Becker
ad of adding new > >> > function we could extend packages_depenedncies then? To accept file > path to > >> > dsc file. > >> > > >> > What about repos.dcf? Maybe additional repositories could be an > attribute > >> > attached to ret

Re: [Rd] tools:: extracting pkg dependencies from DCF

2022-10-15 Thread Gabriel Becker
uot; [6] "grid" [7] "dplyr" [8] "tibble" [653] "rjson" [654] "rsolr" [655] "rlecuyer" [656] "filelock" Now you should probably move the PACKAGES file somewhere else and not leave it in your package library, but I trust th

Re: [Rd] tools:: extracting pkg dependencies from DCF

2022-10-14 Thread Gabriel Becker
Hi Jan and Jan, Can you explain a little more what exactly you want the non-recursive, non-version aware dependencies from an individual package for? Either way package_dependencies will do this for you* with a little "aggressive convincing". It wants output from available.packages, but who

Re: [Rd] Proposal to limit Internet access during package load

2022-09-26 Thread Gabriel Becker
there's no connectivity, the package won't work (the canned file would just set the repositories to URLs that R still won't be able to reach). Anyway, Thanks ~G On Mon, Sep 26, 2022 at 3:11 PM Simon Urbanek wrote: > > > > On 27/09/2022, at 11:02 AM, Gabriel Becker > wrote: > &g

Re: [Rd] Proposal to limit Internet access during package load

2022-09-26 Thread Gabriel Becker
For the record, the only things switchr (my package) is doing internet wise should be hitting the bioconductor config file ( http://bioconductor.org/config.yaml) so that it knows the things it need to know about Bioc repos/versions/etc (at load time, actually, not install time, but since install

Re: [Rd] Proposal to limit Internet access during package load

2022-09-26 Thread Gabriel Becker
Hi Simon, The example of this I'm aware of that is most popular and widely used "in the wild" is the stringi package (which is a dep of the widely used stringr pkg) whose configure file downloads the ICU Data Library (icudt). See https://github.com/gagolews/stringi/blob/master/configure#L5412

Re: [Rd] Respecting custom repositories files in interactive/batch R sessions

2022-09-15 Thread Gabriel Becker
Hi Dirk, So there's a couple of things going on. First off you're correct that that works generally. There are a couple of reasons that made it not. The first is a bug/design error in Rstudio which is causing the R_PROFILE to not be adhered to when you build there. I will be filing a bug

[Rd] Respecting custom repositories files in interactive/batch R sessions

2022-09-15 Thread Gabriel Becker
Hi all, A company I work with mirrors CRAN internally behind its firewall for security (and reproducibility/consistency/etc) reasons. In that case, we would like all R processes (across all the R CMD *, as well as interactive and batch sessions) to automatically hit our cran mirror instead of

Re: [Rd] [External] Re: svd() results should have a class

2022-06-23 Thread Gabriel Becker
This does make sense to me, though I admit to not feeling super strongly about it. Particularly in the light of the precedent from qr(). It would also be "mostly" backwards compatible, as there would not be methods for the new class for existing code to get hung up on out of the gate.

Re: [Rd] string concatenation operator (revisited)

2021-12-06 Thread Gabriel Becker
ring, >> you should use "" or NULL, not NA. >> >> I'd agree with Gabe, paste0("abc", NA) shouldn't give "abcNA", it should >> give NA. >> >> Duncan Murdoch >> >> > >> > Avi >> > >> > On Mon,

Re: [Rd] string concatenation operator (revisited)

2021-12-06 Thread Gabriel Becker
Hi All, Seeing this and the other thread (and admittedly not having clicked through to the linked r-help thread), I wonder about NAs. Should NA "hi there" not result in NA_character_? This is not what any of the paste functions do, but in my opinoin, NA + seems like it should be NA (not

Re: [Rd] .onLoad, packageStartupMessage, and R CMD check

2021-11-04 Thread Gabriel Becker
Hi Michael, Indeed, just to elaborate further on what I believe Duncan's point is, can you give any examples, "dire" or not, that are appropriate when the package is loaded but not attached (ie none of its symbols are visible to the user without using :::)? The only things I can think of are a

Re: [Rd] parallel PSOCK connection latency is greater on Linux?

2021-11-01 Thread Gabriel Becker
m earlier in this thread was that the culprit was TCP > behavior unique to the Linux network stack. > > Jeff > > On Mon, Nov 1 2021 at 05:55:45 PM -0700, Gabriel Becker < > gabembec...@gmail.com> wrote: > > Jeff, > > Perhaps I'm just missing something here, but ms is genera

Re: [Rd] parallel PSOCK connection latency is greater on Linux?

2021-11-01 Thread Gabriel Becker
Jeff, Perhaps I'm just missing something here, but ms is generally milliseconds, not microseconds (which are much smaller), right? Also, this seems to just be how long it takes to roundtrip serialize iris (in 4.1.0 on mac osx, as thats what I have handy right this moment): > microbenchmark({x

Re: [Rd] [External] Re: Workaround very slow NAN/Infinities arithmetic?

2021-09-30 Thread Gabriel Becker
Mildly related (?) to this discussion, if you happen to be in a situation where you know something is a C NAN, but need to check if its a proper R NA, the R_IsNA function is surprisingly (to me, at least) expensive to do in a tight loop because it calls the (again, surprisingly expensive to me)

Re: [Rd] [External] Re: Update on rtools4 and ucrt support

2021-08-23 Thread Gabriel Becker
Hi all, I will preface this with the fact that I don't do work on windows and the following is based on remembered conversations/talks/etc from a while ago so may be either incorrect or out of date, but I recall one of the major things Jeroen was targeting was use of/integration with a

Re: [Rd] na.omit inconsistent with is.na on list

2021-08-16 Thread Gabriel Becker
me(list=I(list(1,NA,2 > list > 11 > 2 NA > 32 > > is.na(f.list) > list > [1,] FALSE > [2,] TRUE > [3,] FALSE > > na.omit(f.list) > list > 11 > 2 NA > 32 > > On Sat, Aug 14, 2021 at 5:15 PM Gabriel Becker > wrote:

Re: [Rd] na.omit inconsistent with is.na on list

2021-08-14 Thread Gabriel Becker
ght only be able to represent missing values > > like c(NA, NA). > > > > On Fri, 13 Aug 2021 at 17:27, Iñaki Ucar > wrote: > > > > > > On Thu, 12 Aug 2021 at 22:20, Gabriel Becker > > wrote: > > > > > > > > Hi Toby, > > >

Re: [Rd] na.omit inconsistent with is.na on list

2021-08-13 Thread Gabriel Becker
On Thu, Aug 12, 2021 at 4:30 PM Toby Hocking wrote: > Hi Gabe thanks for the feedback. > > On Thu, Aug 12, 2021 at 1:19 PM Gabriel Becker > wrote: > >> Hi Toby, >> >> This definitely appears intentional, the first expression of >> stats:::na.omit.de

Re: [Rd] na.omit inconsistent with is.na on list

2021-08-12 Thread Gabriel Becker
Hi Toby, This definitely appears intentional, the first expression of stats:::na.omit.default is if (!is.atomic(object)) return(object) So it is explicitly just returning the object in non-atomic cases, which includes lists. I was not involved in this decision (obviously) but my

Re: [Rd] Rprofile.site function or variable definitions break with R 4.1

2021-08-12 Thread Gabriel Becker
Hi Andrew and Dirk, The other question to think about is what was your Rprofile.site doing before. We can infer from this error that apparently it was defining things *in the namespace for the base package*. How often is that actually what you wanted it to do/a good idea? I haven't played around

Re: [Rd] Feature request: Change default library path on Windows

2021-07-25 Thread Gabriel Becker
On Sun, Jul 25, 2021, 6:54 AM Steve Haroz wrote: > > Shouldn't it be in one of the AppData directories? > > I asked that same question on twitter. Here was a response > (https://twitter.com/bmwiernik/status/1419033079495147522): > * But it's not for files that should be user-accessible, like a >

Re: [Rd] Clearing attributes returns ALTREP, serialize still saves them

2021-07-03 Thread Gabriel Becker
to it, but if someone tackles it before me hopefully this digging helped some. Best, ~G On Fri, Jul 2, 2021 at 10:18 PM Gabriel Becker wrote: > Hi all, > > I don't have a solution yet, but a bit more here: > > > .Internal(inspect(x2b)) > > @7f913826d590 14 REALSXP g

Re: [Rd] Clearing attributes returns ALTREP, serialize still saves them

2021-07-02 Thread Gabriel Becker
Hi all, I don't have a solution yet, but a bit more here: > .Internal(inspect(x2b)) @7f913826d590 14 REALSXP g0c0 [REF(1)] wrapper [srt=-2147483648,no_na=0] @7f9137500320 14 REALSXP g0c7 [REF(2),ATT] (len=100, tl=0) 0.45384,0.926371,0.838637,-1.71485,-0.719073,... ATTRIB:

Re: [Rd] On read.csv and write.csv

2021-07-01 Thread Gabriel Becker
On Thu, Jul 1, 2021 at 1:46 PM Stephen Ellison wrote: > > Please run the reproducible example provided. > When you do, you will see that write.csv writes an unnecessary empty > header field ("") over the row names column. This makes the number of > header fields equal to the number of columns

Re: [Rd] On read.csv and write.csv

2021-06-30 Thread Gabriel Becker
Hi Stephen, Personally, I don't have super strong feelings about this, but https://datatracker.ietf.org/doc/html/rfc4180#section-2 does say that the optional header line should have the same number of fields as the data records, so in as much as that is the "CSV specification", R's read.csv

Re: [Rd] ALTREP ALTINTEGER_SUM/MIN/MAX Return Value and Behavior

2021-06-29 Thread Gabriel Becker
ackages. If these macros have > matured and it can be made explicit that they return NULL if no method is > applicable, or, better, they internally dispatch to a normal sum method if > this is the case, they could become very manageable and useful. > > Best, > > Sebastian > > &g

Re: [Rd] ALTREP ALTINTEGER_SUM/MIN/MAX Return Value and Behavior

2021-06-29 Thread Gabriel Becker
Also, @Luke Tierney I can prepare a patch that has wrappers delegate to payload's ALTREP class methods for things like sum, min, max, etc once conference season calms down a bit. Best, ~G On Tue, Jun 29, 2021 at 11:07 AM Gabriel Becker wrote: > Hi Sebastian, > > S

Re: [Rd] ALTREP ALTINTEGER_SUM/MIN/MAX Return Value and Behavior

2021-06-29 Thread Gabriel Becker
Hi Sebastian, So the way that it is currently factored, there isn't a good way of getting what you want under the constraints of what Luke said (ALTINTEGER_SUM is not part of the API). I don't know what his reason are for saying that per say and would not want to speak for him, but of the top of

Re: [Rd] S3 weirdness

2021-06-25 Thread Gabriel Becker
On Thu, Jun 24, 2021 at 4:48 PM Gabor Grothendieck wrote: > The fact that zoo:: in one part of the code has a side effect in > another seems not to be in the spirit of functional programming or > modularity. > While this is true, there is no way I know of for a package function to...well,

Re: [Rd] [External] Possible ALTREP bug

2021-06-17 Thread Gabriel Becker
allow > > for them to > > >> allocate. I have fixed the one that got caught by Gabor's > > example, and > > >> a rchk run might be able to pick up others if rchk knows > > these could > > >> allocate. (I

Re: [Rd] [External] Possible ALTREP bug

2021-05-28 Thread Gabriel Becker
Hi Jim et al, Just to hopefully add a bit to what Luke already answered, from what I am recalling looking back at that bioconductor thread Elt methods are used in places where there are hard implicit assumptions that no garbage collection will occur (ie they are called on things that aren't

Re: [Rd] 1954 from NA

2021-05-24 Thread Gabriel Becker
rying a duplicated dataframe of missing data > around with the data - which I argue makes it easier to reason with, at the > cost of storage. However this is just my approach, and there are others out > there). > > Best, > > Nick > > On Tue, 25 May 2021 at 01:16, A

Re: [Rd] 1954 from NA

2021-05-24 Thread Gabriel Becker
Hi Adrian, I had the same thought as Luke. It is possible that you can develop an ALTREP that carries around the tagging information you're looking for in a way that is more persistent (in some cases) than R-level attributes and more hidden than additional user-visible columns. The downsides to

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

2021-05-04 Thread Gabriel Becker
ugh using > if(requireNamespace("pkgname")) is preferred, if possible. > > ... > > > Some people have assumed that a ‘recommended’ package in ‘Suggests’ > can safely be used unconditionally, but this is not so. (R can be > installed without recommended packages, and

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

2021-05-04 Thread Gabriel Becker
Hi Henrik, A couple of things. Firstly, so far asI have ever heard, it's valid that a package have hard dependencies in its tests for packages listed only in Suggests. In fact, that is one of the stated purposes of Suggests. An argument could be made, I suppose, that the base packages should be

Re: [Rd] as.list fails on functions with S3 classes

2021-04-28 Thread Gabriel Becker
On Wed, Apr 28, 2021 at 6:04 PM brodie gaslam wrote: > > > On Wednesday, April 28, 2021, 5:16:20 PM EDT, Gabriel Becker < > gabembec...@gmail.com> wrote: > > > > > The analogous case for non-closures to what you are describing would be > for > > S3 to c

Re: [Rd] as.list fails on functions with S3 classes

2021-04-28 Thread Gabriel Becker
Hi Antoine, I would say this is the correct behavior. S3 dispatch is solely (so far as I know?) concerned with the "actual classes" on the object. This is because S3 classes act as labels that inform dispatch what, and in what order, methods should be applied. You took the function class (ie

Re: [Rd] Potential improvements of ave?

2021-03-16 Thread Gabriel Becker
; Also, many timeseries, graphics and spline functions are dependent on the > order. > > In the case of data.frame(s), a boolean flag would probably need to be > extended to allow for multiple column sorting, and > ascending/descending options. > > On Tue, Mar 16, 2021 at

[Rd] Undefined (so far as I can tell?) behavior of browser when called at top level of sourced script?

2021-03-16 Thread Gabriel Becker
Hi all, I was asked a question about why browser() was behaving a specific way, and it turned out that it was being called in a script (rather than in a function). Putting aside the design considerations that lead to that, the behavior is actually a bit puzzling, and so far as I have been able

Re: [Rd] Potential improvements of ave?

2021-03-15 Thread Gabriel Becker
Abby, Vectors do have an internal mechanism for knowing that they are sorted via ALTREP (it was one of 2 core motivating features for 'smart vectors' the other being knowledge about presence of NAs). Currently I don't think we expose it at the R level, though it is part of the official C API. I

[Rd] NCOL, as.matrix, cbind and NULL

2021-02-16 Thread Gabriel Becker
Hi all, so I've known for a while that NROW(NULL) gives 0, where nrow(NULL) gives an error, so I naively expected NCOL to do the same. Of course, it does not, and is documented* (more on this in a bit) as not doing so. For those reading without the documentation open, it gives 1. The relevant

Re: [Rd] Allowing S3 methods of rounding functions to take `...`

2021-01-28 Thread Gabriel Becker
Out of my naive curiosity, what arguments are you hoping a method for t() will take? I mean honestly an argument could be made that all S3 generics should take I don't think its an overwhelmingly compelling one, but I d see some merit to it given what an s3 generic is at its core. ~G On

Re: [Rd] Inconsistency of c.Date: non-commutativity and non-integer Value

2021-01-22 Thread Gabriel Becker
Hi Jens, On Fri, Jan 22, 2021 at 1:18 PM Dirk Eddelbuettel wrote: > > On 22 January 2021 at 21:35, Jens Heumann wrote: > | Dear r-devel, > | > | Today I came across what I would call inconsistencies in the `c.Date` > | method compared to what happens when concatenating other classes: 1. > |

Re: [Rd] `merge()` not consistent in how it treats list columns

2021-01-02 Thread Gabriel Becker
Hi Antoine, On Sat, Jan 2, 2021 at 11:16 AM Antoine Fabri wrote: > Dear R-devel, > > When trying to merge 2 data frames by an "id" column, with this column a > character in one of them, and a list of character in the other, merge > behaves differently depending which is given first. > >

Re: [Rd] Ignore Sites Option For libPaths

2020-12-20 Thread Gabriel Becker
Hi all, I had intended to do this sooner, but I have filed a wishlist entry, with patch, for supporting this on bugzilla. Best, ~G On Wed, Dec 9, 2020 at 10:48 AM Dirk Eddelbuettel wrote: > > On 9 December 2020 at 09:49, Martin Maechler wrote: > | Also, R allows the user to remove their own

Re: [Rd] quantile() names

2020-12-14 Thread Gabriel Becker
Hi Edgar, I certainly don't think quantile(x, .975) should return 980, as that is a completely wrong answer. I do agree that it seems like the name is a bit offputting. I'm not sure how deep in the machinery you'd have to go to get digits to no effect on the names (I don't have time to dig in

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

2020-12-09 Thread Gabriel Becker
On Wed, Dec 9, 2020 at 8:26 AM Gabor Grothendieck wrote: > On Wed, Dec 9, 2020 at 10:08 AM Duncan Murdoch > wrote: > > > > 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

Re: [Rd] Ignore Sites Option For libPaths

2020-12-08 Thread Gabriel Becker
Of course you can, but the ability to do something via R code and the ability to do them by wrapping the invocation of R are not similar terms of convenience, IMO. I say that as someone who routinely does both type of thing. ~G On Tue, Dec 8, 2020 at 4:07 PM Dirk Eddelbuettel wrote: > > On 8

Re: [Rd] Ignore Sites Option For libPaths

2020-12-08 Thread Gabriel Becker
Hi Dario, My switchr package is designed specifically to do what you're describing, and does support excluding site libraries. So clearly I agree it would be useful, but also, it does go against the "concept" of site libraries somewhat. I agree it would be a useful addition with the default to

Re: [Rd] New pipe operator

2020-12-07 Thread Gabriel Becker
Hi Denes, On Mon, Dec 7, 2020 at 2:52 PM Dénes Tóth wrote: > > > This gave me the idea that naming the arguments can be used to skip the > placeholder issue: > > "funny" |> sub(pattern = "f", replacement = "b") > > Of course this breaks if the maintainer changes the order of the > function

Re: [Rd] New pipe operator

2020-12-07 Thread Gabriel Becker
On Mon, Dec 7, 2020 at 11:05 AM Kevin Ushey wrote: > IMHO the use of anonymous functions is a very clean solution to the > placeholder problem, and the shorthand lambda syntax makes it much > more ergonomic to use. Pipe implementations that crawl the RHS for > usages of `.` are going to be more

Re: [Rd] New pipe operator

2020-12-07 Thread Gabriel Becker
On Mon, Dec 7, 2020 at 10:35 AM Gabor Grothendieck wrote: > On Mon, Dec 7, 2020 at 12:54 PM Duncan Murdoch > wrote: > > An advantage of the current implementation is that it's simple and easy > > to understand. Once you make it a user-modifiable binary operator, > > things will go kind of

Re: [Rd] New pipe operator

2020-12-06 Thread Gabriel Becker
re is not some overarching inviolable principle being violated here, I think. Now you may say "well thats just the parser, it has to parse + specially because its an operator with specific precedence etc". Well, the same exact thing is true of |> I think. Best, ~G > > On Sun, Dec

Re: [Rd] New pipe operator

2020-12-06 Thread Gabriel Becker
Hi Gabor, On Sun, Dec 6, 2020 at 12:52 PM Gabor Grothendieck wrote: > I think the real issue here is that functions are supposed to be > first class objects in R > or are supposed to be and |> would break that if if is possible > to write function(x) x + 1 on the RHS but not foo (assuming foo >

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

2020-12-06 Thread Gabriel Becker
Hi Denes, On Sun, Dec 6, 2020 at 6:43 AM 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 like to thank you for putting effort into > this feature. Keeping it at the syntax level is also a very smart > decision.

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

2020-11-20 Thread Gabriel Becker
And the related: > f = function() stop(return("lol")) > f() [1] "lol" I have a feeling all of this is just return() performing correctly though. If there are already R CMD CHECK checks for this kind of thing (I wasnt sure but I'm hearing from others there may be/are) that may be (and/or may

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

2020-11-20 Thread Gabriel Becker
Hi all, I can confirm this occurs for me as well. The one thing that comes to mind is that there are certain larger expressions that contain calls to return which we absolutely don't want to be an error, e.g if(somestuff) return(TRUE) That said, the actual expression Mateo pointed out

Re: [Rd] [External] exists, get and get0 accept silently inputs of length > 1

2020-11-16 Thread Gabriel Becker
get(). Hence the change expanding the > domain of get(). > > luke > > On Tue, 17 Nov 2020, Gabriel Becker wrote: > > > Hi all, > > I have used variable values in get() as well, and including, I think, in > > package code (though pretty infrequently). > > Perh

Re: [Rd] [External] exists, get and get0 accept silently inputs of length > 1

2020-11-16 Thread Gabriel Becker
Hi all, I have used variable values in get() as well, and including, I think, in package code (though pretty infrequently). Perhaps a character.only argument similar to library? ~G On Mon, Nov 16, 2020 at 5:31 PM Hugh Parsonage wrote: > I noticed the recent commit to R-dev (r79434). Is this

Re: [Rd] sum() (and similar methods) should work for zero row data.frames

2020-10-18 Thread Gabriel Becker
Peter et al, I had the same thought, in particular for any() and all(), which in as much as they should work on data.frames in the first place (which to be perfectly honest i do find quite debatable myself), should certainly work on "logical" data.frames if they are going to work on "numeric"

Re: [Rd] tools::package_dependencies problems

2020-10-16 Thread Gabriel Becker
Hi Spencer, You just need an available.packages matrix which reflects the reality you want to test against. There are probably various ways of getting one of these, but switchr allows you to build repositories off of many things including local directories, so you could do something like >

Re: [Rd] Coercion function does not work for the ALTREP object

2020-10-07 Thread Gabriel Becker
Jiefei, Where does the code for your altrep class live? Thanks, ~G On Wed, Oct 7, 2020 at 4:25 AM Jiefei Wang wrote: > Hi all, > > The coercion function defined for the ALTREP object will not be called by R > when an assignment operation implicitly introduces coercion for a large > ALTREP

Re: [Rd] S4 - inheritance changed by order of setClassUnion and setAs()

2020-10-05 Thread Gabriel Becker
Andreas, As far as I can tell (/conjecture), this is because the list of classes a particular class inherits from directly is appended to as needed, and so the order that a class extends others isd refined by the order that those connections are defined. We can see this with two setClassUnion

Re: [Rd] Internet access and R CMD make check-devel

2020-10-05 Thread Gabriel Becker
Thomas, In my experience, as pointed out also by Gabor, its often part of the devops build process to remove/comment out these tests or otherwise modify them so that they will pass (if they SHOULD pass) in your environment. That said, a quick look at the Makefile does suggest that failing on the

Re: [Rd] [External] Thread-safe R functions

2020-09-13 Thread Gabriel Becker
Jiefei, Beyond the general response that Luke gave, to be a bit more specific to what you said, DATAPTR and INTEGER_GET_REGION involve ALTREP method execution (for ALTREP objects, obviously) so even they are not as simple and straightforward as they were a couple years ago. They should not (any

Re: [Rd] some questions about R internal SEXP types

2020-09-08 Thread Gabriel Becker
Dan, Sounds like a cool project! Response to one of your questions inline On Mon, Sep 7, 2020 at 4:24 AM Dan Kortschak via R-devel < r-devel@r-project.org> wrote: > > The last question is more a question of interest in design strategy, > and the answer may have been lost to time. In order to

Re: [Rd] utils::isS3stdGeneric chokes on primitives and identity

2020-08-30 Thread Gabriel Becker
Submitted to bugzilla here: https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17901 On Sat, Aug 29, 2020 at 1:57 PM Gabriel Becker wrote: > Hi all, > > I have a patch that fixes this and also fixes/improves debugcall so that > it supports pkg::fun(obj) and pkg:::fun(obj) styl

Re: [Rd] utils::isS3stdGeneric chokes on primitives and identity

2020-08-29 Thread Gabriel Becker
On Thu, Aug 27, 2020 at 5:28 PM Gabriel Becker wrote: > Trace adds something to the body of the function, so it does make sense > that it doesn't. Whether traced functions still technically meet the > definition of standard s3 generic or not is, I suppose, up for debate, but >

Re: [Rd] utils::isS3stdGeneric chokes on primitives and identity

2020-08-27 Thread Gabriel Becker
09:58, Kurt Hornik a écrit : > >> >>>>> Gabriel Becker writes: >> >> > I added that so I can look at the proposed fix and put it or something >> > similar in bugzilla for review final review. >> >> > Apologies for the oversight. >

[Rd] NAs and rle

2020-08-25 Thread Gabriel Becker
Hi All, A twitter user, Mike fc (@coolbutuseless) mentioned today that he was surprised that repeated NAs weren't treated as a run by the rle function. Now I know why they are not. NAs represent values which could be the same or different from eachother if they were known, so from a purely

Re: [Rd] utils::isS3stdGeneric chokes on primitives and identity

2020-08-19 Thread Gabriel Becker
I added that so I can look at the proposed fix and put it or something similar in bugzilla for review final review. Apologies for the oversight. ~G On Wed, Aug 19, 2020 at 3:40 PM Antoine Fabri wrote: > Dear R-devel, > > utils::isS3stdGeneric tries to subset the body of the function it's fed,

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

2020-07-30 Thread Gabriel Becker
Tommy, I'm not Duncan (and am not nor claim to be an RNG expert) but I believe RNG streams are designed and thus tested, to be used as streams. Repeatedly setting the seed after small numbers of samples from them does not fit the designed usecase (And also doesn't match the test criteria by which

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

2020-07-20 Thread Gabriel Becker
Mario, Abby, et al. Note that there is no fully safe way of unloading packages which register methods (as answered by Luke Tierney here: https://bugs.r-project.org/bugzilla/show_bug.cgi?id=16644 ) which makes the single R session running arbitrary different scripts thing pretty iffy over the long

Re: [Rd] mget(missingArgument)?

2020-06-22 Thread Gabriel Becker
At first I thought this was more or less correct, because > f = function(x) { y <- mget("x")[[1]]; missing(y)} > f() [1] TRUE reflects the actual "value" of x, but then at the very least this > f = function(x) { y <- mget("x")[[1]]; y} > f() *Error in f() : argument "y" is missing, with

Re: [Rd] paste(character(0), collapse="", recycle0=FALSE) should be ""

2020-05-24 Thread Gabriel Becker
On Sat, May 23, 2020 at 9:59 PM Hervé Pagès wrote: > On 5/23/20 17:45, Gabriel Becker wrote: > > Maybe my intuition is just > > different but when I collapse multiple character vectors together, I > > expect all the characters from each of those vectors to be in the > &

Re: [Rd] paste(character(0), collapse="", recycle0=FALSE) should be ""

2020-05-23 Thread Gabriel Becker
t; > > > Now with 'collapse0=TRUE', we finally have the opportunity to make it do > > the right thing. Let's not miss that opportunity. > > > > Cheers, > > H. > > FWIW what convinces me is consistency with other aggregating functions > applied > to zero leng

Re: [Rd] paste(character(0), collapse="", recycle0=FALSE) should be ""

2020-05-23 Thread Gabriel Becker
UE) if length(y) is 0, it literally makes no difference when x and z are. I seem to be being largely outvoted anyway though, so we will see what Martin and others who may pop up might think, but I raised the points I wanted to raise so we'll see where things ultimately fall. ~G > &g

Re: [Rd] paste(character(0), collapse="", recycle0=FALSE) should be ""

2020-05-22 Thread Gabriel Becker
business in the 'collapse' operation >> (which comes after the 'sep' operation): this operation still behaves >> like it always had. >> >> That's all there is to it. >> >> H. >> >> >> On 5/22/20 03:00, Gabriel Bec

Re: [Rd] paste(character(0), collapse="", recycle0=FALSE) should be ""

2020-05-22 Thread Gabriel Becker
ty of sense: the 1st > > operation is binary (or n-ary) while the collapse operation is > unary. > > There is no concept of recycling in the context of unary operations. > > Interesting, ..., and sounding somewhat convincing. > > > On 5/15/20 11:25, Gabriel

  1   2   3   4   >