Re: [Rd] Add on argument in seq()

2015-06-15 Thread Gabriel Becker
And I haven't found in ?seq() the particular behavior of this function > when length.out = 1. > > > > Thanks for your help ! > > > > Best, > > > > Gael. > > > > > > De : Gabriel Becker [mailto:gmbec...@ucdavis.edu] > > Envoyé : lund

Re: [Rd] Improving string concatenation

2015-06-16 Thread Gabriel Becker
On Jun 16, 2015 3:44 PM, "Joshua Bradley" wrote: > > Hi, first time poster here. During my time using R, I have always found > string concatenation to be (what I feel is) unnecessarily complicated by > requiring the use of the paste() or similar commands. I don't follow. In what sense is paste co

Re: [Rd] Multi-line comments in R

2015-08-20 Thread Gabriel Becker
-expression it would affect .Last.value, I think, though not in the particular case you posted. ~G > Yes, you have to escape any string quote marks in your comment, but in > python you have to escape any triple-quote marks. > > Barry > > __

Re: [Rd] mclapply memory leak?

2015-09-02 Thread Gabriel Becker
s_0.2.3reshape2_1.2.2 proto_1.0.0 > [10] labeling_0.2tools_3.2.2 stringr_0.6.2 > [13] dichromat_2.0-0 munsell_0.4.2 > PeakSegJoint_2015.08.06 > [16] compiler_3.2.2 colorspace_1.2-4 > > [[alternative HTML version deleted]] &g

Re: [Rd] making object.size() more meaningful on environments?

2015-09-29 Thread Gabriel Becker
B514 > P.O. Box 19024 > Seattle, WA 98109-1024 > > E-mail: hpa...@fredhutch.org > Phone: (206) 667-5791 > Fax:(206) 667-1319 > > __________ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >

Re: [Rd] authorship and citation

2015-10-06 Thread Gabriel Becker
Bucharest sector 5 > Romania > > [[alternative HTML version deleted]] > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > -- Gabriel Becker, PhD Computational Biologist Bioinformatics and Computational Biology Genentech,

Re: [Rd] authorship and citation

2015-10-06 Thread Gabriel Becker
Adrian, Responses inline On Tue, Oct 6, 2015 at 1:58 PM, Adrian Dușa wrote: > Hi Gabriel, > > On Tue, Oct 6, 2015 at 10:59 PM, Gabriel Becker > wrote: > >> [...] >> >> At the very least, this is seems to be a flagrant violation of the >> *spirit* of the

Re: [Rd] authorship and citation

2015-10-06 Thread Gabriel Becker
On Tue, Oct 6, 2015 at 2:52 PM, Adrian Dușa wrote: > Dear Gabriel, > > On Wed, Oct 7, 2015 at 12:39 AM, Gabriel Becker > wrote: > >> [...] >> >>> >>> I apologize for pushing this topic to the limit, but I haven't got an >>> answer to

Re: [Rd] authorship and citation

2015-10-07 Thread Gabriel Becker
practice" with regard to software-related publications, and it certainly isn't what I would choose to do in that situation. Best, ~G On Wed, Oct 7, 2015 at 4:59 AM, Hadley Wickham wrote: > On Tue, Oct 6, 2015 at 4:58 PM, Adrian Dușa wrote: > > Hi Gabriel, > > >

Re: [Rd] reverse object creation

2015-10-09 Thread Gabriel Becker
Bo, More philosophically, the dput output is more idiomatically appropriate for R. Data.frames are emphatically column-major data structures in R, by (very good) design. Best, ~G On Oct 9, 2015 3:55 AM, "Thierry Onkelinx" wrote: > Dear Bo, > > Please keep the mailing list in cc. > > Your funct

Re: [Rd] C_LogLin (stats/loglin)

2015-10-22 Thread Gabriel Becker
ble, start, nmar, eps, iter) > ... > > > -- > Kai Nitschke, Dipl.-Psych. > > Division of Functional Brain Imaging (FBI) > Dept. of Neurology, University of Freiburg > > Breisacher Str. 64, 79095 Freiburg, Germany > Phone: +49 (0) 761 270 - 50410 > Email: kai.

Re: [Rd] Changed behaviour when passing a function?

2015-10-22 Thread Gabriel Becker
Mathematical Modelling, Statistics and Bio-Informatics > > tel : +32 (0)9 264 61 79 > joris.m...@ugent.be > --- > Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php > > [[alternative HTML version deleted]] > >

Re: [Rd] Changed behaviour when passing a function?

2015-10-22 Thread Gabriel Becker
= round, digits=1) > Error in myfun(0.85, FUN = round, digits = 1) (from #2) : > could not find function "FUN" > > I see this in 3.2.2, R-patched and R-devel. > > Duncan Murdoch > > > __ > R-devel@r-project.

Re: [Rd] inconsistency in POSIXlt

2015-12-07 Thread Gabriel Becker
think the answer is R doesn't let you do that because it takes care of it for you. (Unless someone more familiar with date handling in R pops in and points out how I've completely missed something). Best, ~G -- Gabriel Becker, PhD Associate Scientist (Bioinformatics

Re: [Rd] integer

2015-12-17 Thread Gabriel Becker
rsity of Bucharest > Romanian Social Data Archive > Soseaua Panduri nr.90 > 050663 Bucharest sector 5 > Romania > > [[alternative HTML version deleted]] > > __________ > R-devel@r-project.org mailing list > https://stat.ethz.

Re: [Rd] Suggested dependencies in context of R CMD check

2016-04-04 Thread Gabriel Becker
ages will fail to cleanly pass R CMD > check if suggested packages are missing. In my experience, it's much > easier to simply install all dependencies of your reverse dependencies > (although this is obviously much easier when you're using a platform > with binary packages avai

Re: [Rd] (no) circular dependency

2016-04-08 Thread Gabriel Becker
gt;>>> >> Hello all, > >>>> >> > >>>> >> I would like to build two packages (say A and B), for two different > >>>> >> purposes. > >>>> >> Each of them need one or two functions from the other, which leads

Re: [Rd] S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment

2016-04-19 Thread Gabriel Becker
sanity check in line 655 of src/main/attrib.c is > >>> making wrong assumptions, but there might be other reasons. > >>> > >>> ( > https://github.com/wch/r-source/blob/780021752eb83a71e2198019acf069ba8741103b/src/main/attrib.c#L655-L656 > ) > >>> > >>> Same behavior in R 3.2.4, R 3.2.5 and R-devel r70420. > >>> > >>> > >>> Best regards > >>> > >>> Kirill > >>> > >>> __ > >>> R-devel@r-project.org mailing list > >>> https://stat.ethz.ch/mailman/listinfo/r-devel > >>> > > > > > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > -- Gabriel Becker, PhD Associate Scientist (Bioinformatics) Genentech Research [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment

2016-04-19 Thread Gabriel Becker
after fixing the check to ensure that R_MethodsNamespace > is not R_GlobalEnv, but one could load a serialized S4 object and > expect S3 dispatch to work with Rscript. > > On Tue, Apr 19, 2016 at 6:51 AM, Gabriel Becker > wrote: > > See also .isMethodsDispatchOn, which is

Re: [Rd] identical on closures

2016-05-20 Thread Gabriel Becker
LOENV(y) ? TRUE : FALSE) && >>(IGNORE_BYTECODE || R_compute_identical(BODY(x), BODY(y), >> flags)) >>); >> >> R-3.2.4, Mac OS X El Capitan >> > Ok, I figured it out, but this is VERY unintuitive IMHO: > > > identical(attributes(functio

Re: [Rd] Suggestion: mkString(NULL) should be NA

2016-05-24 Thread Gabriel Becker
t; NA_STRING rather than segfault at strlen(NULL). This automatically > fixes mkString(NULL) as well which wraps mkChar (See Rinlinedfuns.h). > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >

Re: [Rd] Suggestion: mkString(NULL) should be NA

2016-05-24 Thread Gabriel Becker
On Tue, May 24, 2016 at 9:30 AM, Jeroen Ooms wrote: > On Tue, May 24, 2016 at 5:59 PM, Gabriel Becker > wrote: > > Shouldn't Rf_mkString(NULL) return (the c-level equivalent of) > character() > > rather than the NA_character_? > > No. It should still be safe

Re: [Rd] Calling C implementations of rnorm and friends

2016-06-30 Thread Gabriel Becker
Luis, C_rnorm is a symbol but it's not exported. This means that you *can* do this by using stats:::C_rnorm. That said, it's not exported, which means that it's not supported to do this. So your package likely would not be allowed on CRAN, for example. Best, ~G On Jun 30, 2016 2:08 PM, "Luis Us

Re: [Rd] Calling C implementations of rnorm and friends

2016-07-01 Thread Gabriel Becker
call compiled code" and "Compiled > code in a base package" from this answer: > http://stackoverflow.com/a/19226817/271616 > > That should give you a few pointers on where/how to look. > > > Thanks, > > > > Luis > > > > On Thu, Jun 30, 2

Re: [Rd] [R] Forking and adapting an R package

2016-07-15 Thread Gabriel Becker
hecking DESCRIPTION meta-information ... OK > > > * cleaning src > > > * installing the package to build vignettes > > > * creating vignettes ... ERROR > > > > > > Error: processing vignette 'hexagon_binning.Rnw' failed with > dia

Re: [Rd] A bug in the R Mersenne Twister (RNG) code?

2016-09-01 Thread Gabriel Becker
then please send me the R code to >>> initialize the MT code within R to successfully do that, and I apologize >>> for having wasted your time. If you (collectively) can't do that, then R >>> is very likely using incorrectly implemented MT code. And if this >&g

Re: [Rd] R (development) changes in arith, logic, relop with (0-extent) arrays

2016-09-08 Thread Gabriel Becker
last above: The (binary operation) between a > >> non-0-length array and a 0-length vector (and NULL which should > >> be treated like a 0-length vector): > >> > >> R <= 3.3.1 *is* quite inconsistent with these: > >> > >> >

Re: [Rd] mget call can trigger C stack usage error

2016-09-08 Thread Gabriel Becker
http://sites.google.com/site/alexandrecourtiol/home > > *"Science is the belief in the ignorance of experts"*, R. Feynman > > [[alternative HTML version deleted]] > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >

Re: [Rd] R (development) changes in arith, logic, relop with (0-extent) arrays

2016-09-08 Thread Gabriel Becker
ype check should be done before the length check. > > > Bill Dunlap > TIBCO Software > wdunlap tibco.com > > On Thu, Sep 8, 2016 at 8:43 AM, Gabriel Becker > wrote: > >> Martin, >> >> Like Robin and Oliver I think this type of edge-case consistency is >&g

Re: [Rd] R (development) changes in arith, logic, relop with (0-extent) arrays

2016-09-09 Thread Gabriel Becker
it. In light of that, it seems that it would be allowable to have different behavior based on the length of the other vector. Furthermore, while I acknowledge the usefulness of the x = numeric() x < 5 case (i.e., the other vector is length 1), I can't come up with any use of, e

Re: [Rd] R (development) changes in arith, logic, relop with (0-extent) arrays

2016-09-12 Thread Gabriel Becker
ng the magnitude of > benefit that would justify imposing this burden on users. A language > specification shouldn't really be changing all the time for no > particular reason. > >Radford Neal > > __ > R-devel@r-project.org

Re: [Rd] Cluster: Various GCC, how important is consistency?

2016-10-17 Thread Gabriel Becker
This absolutely causes it's own problems (and they may be bad enough that you shouldnt do it) but you can also install an older version of rcpparmadillo. My switchr package makes this more convenient from within r but grabbing tarballs from the crank Web archive also works (in fact that's what swi

Re: [Rd] ifelse() woes ... can we agree on a ifelse2() ?

2016-11-15 Thread Gabriel Becker
g at (my mom's 86th birthday): > ##' https://stat.ethz.ch/pipermail/r-devel/2016-August/072970.html > ifelse2 <- function (test, yes, no, NA. = NA) { > if(!is.logical(test)) { > if(is.atomic(test)) > storage.mode(test) <- "logical" > else ## typ

Re: [Rd] ifelse() woes ... can we agree on a ifelse2() ?

2016-11-22 Thread Gabriel Becker
mpfr" (the arbitrary-precision numbers in my package "Rmpfr") > >> > >> Also if you are not on github, you can quickly get to the ifelse2() > >> definition : > >> > >> https://gist.github.com/mmaechler/9cfc3219c4b89649313bfe6

Re: [Rd] ifelse() woes ... can we agree on a ifelse2() ?

2016-11-28 Thread Gabriel Becker
[0] > >> >> > length(out) <- max(length(yes), length(no)) > >> >> > >> >> yes; this would require that a `length<-` method works for > the > >> >> class of the res

Re: [Rd] accessing data by packagename::dataname from within package code fails.

2016-12-12 Thread Gabriel Becker
t; > bibliospec::AminoAcids > > > > But I can't access it from the package bibliospec code. > > So why can't I access bibliospec::AminoAcids from within package code? > > > > Help appreciated > > > > Witold >

Re: [Rd] How to handle INT8 data

2017-01-20 Thread Gabriel Becker
> > reference: > 1. https://www.r-bloggers.com/r-in-a-64-bit-world/ > > -- > Nicolas PARIS > > __________ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > -- Gabriel Becker, PhD Associate Scientist (Bioinformatics)

Re: [Rd] How to handle INT8 data

2017-01-20 Thread Gabriel Becker
lots of problems when > dealing > > with > > > certain types of data where the loss of precision from coercing to > 53 > > bits with > > > double is unacceptable. > > > > Hello Murray, > > Do you mean, by eg. -13110719

Re: [Rd] How to handle INT8 data

2017-01-20 Thread Gabriel Becker
needs. > Any chances such an external package for int64 would be integrated in core > ? > > > Le 20 janv. 2017 à 18h57, Gabriel Becker écrivait : > > How many unique idenfiiers do you have? > > > > If they are large (in terms of bytes) but you don't have that many

Re: [Rd] can we override "if" in R?

2017-03-05 Thread Gabriel Becker
;if". > >> >> >> > >> >> >> Best, > >> >> >> Da > >> >> >> > >> >> >> On Sat, Mar 4, 2017 at 12:41 PM, Gábor Csárdi > >> >> >> > >> >> >&

Re: [Rd] can we override "if" in R?

2017-03-06 Thread Gabriel Becker
had to remember to "typecast", which was prone to "user error". > > Whether this kind of thing is worth the "risk", is another matter. > > cheers > Mark > > Mark Bravington > CSIRO Marine Lab > Hobart > Australia > > _

Re: [Rd] Control statements with condition with greater than one should give error (not just warning) [PATCH]

2017-03-07 Thread Gabriel Becker
gt; >> > > >> With your 2nd e-mail of saying that you'd propose such an > > >> option only for a few releases of R you've indeed > > >> clarified your intent to me. OTOH, I would prefer using > >

Re: [Rd] Support for user defined unary functions

2017-03-16 Thread Gabriel Becker
etId( $$, @$); } > | '?' expr{ $$ = xxunary($1,$2); > setId( $$, @$); } > > | expr ':' expr { $$ = > xxbinary($2,$1,$3); setId( $$, @$); } > > _

Re: [Rd] Support for user defined unary functions

2017-03-16 Thread Gabriel Becker
to applaud Norm Matloff for his book > title "The Art of R Programming", > because for me good code should also be beautiful to some extent. > > I really very much prefer > >f(x) > to%f% x > > and hence I really really really cannot see why anybody

Re: [Rd] Support for user defined unary functions

2017-03-17 Thread Gabriel Becker
y is in > >>> the eye of the beholder. > >>> > >>> The unquote example [1] shows one example where this gap in tooling > >>> caused authors to co-opt existing unary exclamation operator, this > >>> same gap is part of the reason the formula

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

2017-03-17 Thread Gabriel Becker
ds, > > - Jonathan. > > [1] https://stat.ethz.ch/pipermail/r-devel/2017-March/073894.html > [2] https://twitter.com/carroll_jono/status/842142292253196290 > [3] https://dev.mysql.com/doc/refman/5.7/en/user-variables.html > > [[alternative HTML version deleted]] > > ___

Re: [Rd] Support for user defined unary functions

2017-03-17 Thread Gabriel Becker
oes it give us that the current tilde function does not? > > > Bill Dunlap > TIBCO Software > wdunlap tibco.com > > > On Fri, Mar 17, 2017 at 6:46 AM, Gabriel Becker > wrote: > > Jim, > > > > One more note about precedence. It prevents a solution like the one

Re: [Rd] Support for user defined unary functions

2017-03-17 Thread Gabriel Becker
d we do with multicall expressions?] > > We probably need to come up with a better name than 'non-standard > evaluation' since there are lots of non-standard ways of doing things. > Bill Dunlap > TIBCO Software > wdunlap tibco.com > > > On Fri, Mar 17, 2017 at

Re: [Rd] Transferring ownership of R-managed buffer

2017-03-29 Thread Gabriel Becker
TML version deleted]] > >> > >> __ > >> R-devel@r-project.org mailing list > >> https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.et > >> hz.ch_mailman_listinfo_r-2Ddevel&d=DwICAg&c=eRAMFD45gAfqt8

Re: [Rd] Transferring ownership of R-managed buffer

2017-03-30 Thread Gabriel Becker
On Thu, Mar 30, 2017 at 11:52 AM, Tim Keitt wrote: > > On Wed, Mar 29, 2017 at 4:56 PM, Gabriel Becker > wrote: > >> The concept of having a vector which is a "window" into another vector >> without duplication ( which I suspect is at least related to your us

Re: [Rd] tempdir() may be deleted during long-running R session

2017-04-25 Thread Gabriel Becker
ould save the R session by >Sys.setenv(TEMPDIR = "") > if for instance /tmp/ suddenly became unwritable for the user. > > What we could consider is making the default of 'check' settable > by an option, and experiment with setting the option to TRUE, so >

[Rd] make check-recommended hanging on up-to-date Rdevel from SVN

2017-07-06 Thread Gabriel Becker
datasets methods base other attached packages: [1] Matrix_1.2-10 loaded via a namespace (and not attached): [1] compiler_3.5.0 grid_3.5.0 lattice_0.20-35 -- Gabriel Becker, PhD Associate Scientist (Bioinformatics) Genentech Research [[alternative HTML version deleted]] _

Re: [Rd] Function 'factor' issues

2017-10-18 Thread Gabriel Becker
d find it ugly (and even more > time consuming!) if factor() itself would have to check its > argument and signal an error for a data.frame. > > The relevant call tree is > > factor() -> order() -> xtfrm() -> xtfrm.default() -> rank() > > and as I said, rank(x

Re: [Rd] FW: R-devel error

2017-12-06 Thread Gabriel Becker
somewhere. >> >> - Either in 'stringr' or 'stringi' in their C code using >>things they should not (because not in R's API), >>which now shows in R-devel where many "inner workings" have been >>modified (key "ALTREP") >> >

Re: [Rd] cannot destroy connection (?) created by readLines in a tryCatch

2017-12-14 Thread Gabriel Becker
can read can write > 0 "terminal" "r" "text" "opened" "yes""no" > 1 "terminal" "w" "text" "opened" "no" "yes" > 2 "terminal" "w" "text" "opened" "no"

Re: [Rd] cannot destroy connection (?) created by readLines in a tryCatch

2017-12-14 Thread Gabriel Becker
On Thu, Dec 14, 2017 at 12:17 PM, Gábor Csárdi wrote: > On Thu, Dec 14, 2017 at 7:56 PM, Gabriel Becker > wrote: > > Gabor, > > > > You can grab the connection and destroy it via getConnection and then a > > standard close call. > > Yeah, that's of

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 no

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] 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] 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,

[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 concep

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

2020-08-27 Thread Gabriel Becker
ût 2020 à 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 overs

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

2020-08-29 Thread Gabriel Becker
G 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-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] 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 red

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 lo

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] 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 cal

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 obje

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 > setwd(

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" ones

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] [External] exists, get and get0 accept silently inputs of length > 1

2020-11-16 Thread Gabriel Becker
g them to 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). >

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 cert

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 ne

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] 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] New pipe operator

2020-12-06 Thread Gabriel Becker
s can exist proves that there 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. Be

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 nuts.

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 e

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 argum

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 in

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 D

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 t

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 rig

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 ho

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. > > Example

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. > | Non-

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 Thu

[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 do

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 d

[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 to

Re: [Rd] Potential improvements of ave?

2021-03-16 Thread Gabriel Becker
egate/split > > 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

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 label

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] 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 u

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

2021-05-04 Thread Gabriel Becker
although 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 pac

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 t

Re: [Rd] 1954 from NA

2021-05-24 Thread Gabriel Becker
ch requires carrying 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 2

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 PROTEC

<    1   2   3   4   >