Re: [Rd] Unexpected argument-matching when some are missing

2018-12-03 Thread Emil Bode
ybe we can write Patrick Burns (the R-inferno) ; - ) Best regards, Emil Bode On 03/12/2018, 10:57, "Martin Maechler" wrote: >>>>> Michael Lawrence >>>>> on Fri, 30 Nov 2018 08:24:31 -0800 writes: > Argument matching is by n

Re: [Rd] Unexpected argument-matching when some are missing

2018-11-30 Thread Emil Bode
nts behave entirely different from omitting them (", ,") And I definitely agree we need a guru to explain it all to us ( Cheers, Emil Bode On 30/11/2018, 15:35, "S Ellison" wrote: > Yes, I think all of that is correct. But y _is_ missing in this sense:

Re: [Rd] Unexpected argument-matching when some are missing

2018-11-30 Thread Emil Bode
It looks like you're right that somewhere in (presumably) match.call, the named, empty arguments are removed, such that the call plot(x=1:10, y=, 10:1) is translated to plot(x=1:10, 10:1). But I would have expected it to be the same as plot(x=1:10, , 10:1) (note the ", ,"), which gives an error

Re: [Rd] Unexpected argument-matching when some are missing

2018-11-29 Thread Emil Bode
n the place of the first unnamed variable, so the result is the same as if calling df[FALSE,,]: [1] a b <0 rows> (or 0-length row.names) What I did expect was the same result as df[,,FALSE], i.e. the full data.frame. Of course I can rewrite the function "doselect", but I think my c

[Rd] Unexpected argument-matching when some are missing

2018-11-29 Thread Emil Bode
tions that are wrong) for R-devel/other R-versions/other platforms? My setup: R 3.5.1, MacOS 10.13.6, both Rstudio 1.1.453 and R --vanilla from Bash Best regards, Emil Bode __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] named arguments discouraged in `[.data.frame` and `[<-.data.frame`

2018-11-29 Thread Emil Bode
Well, the situation with `[.data.frame` (and [<-) is complicated by the fact that the data.frame-method is not a primitive, but the generic IS. I'm not sure about dispatch for primitive-generics, but I bet it's done on the first argument (as with S3). Which means `[`(j=1:2,d,i=1) has nothing to

Re: [Rd] [tryExcept] New try Function

2018-11-23 Thread Emil Bode
s the same environment as used by expr Although this is cumbersome, and it gets even more cumbersome if you want to access the error-object in #abunchofcode, or use #abunchofcode to return to a higher level, so I get it you're looking for a more elegant solution. Best regards, Emil Bode On 23/11

Re: [Rd] Subsetting row in single column matrix drops names in resulting vector

2018-11-22 Thread Emil Bode
for. Hope this solves your problem. Best regards, Emil Bode On 21/11/2018, 17:58, "R-devel on behalf of Dmitriy Selivanov" wrote: Hi Rui. Thanks for answer, I'm aware of drop = FALSE option. Unfortunately it doesn't resolve the issue - I'm expecting to get a vector, no

Re: [Rd] sys.call() inside replacement functions incorrectly returns *tmp*

2018-10-15 Thread Emil Bode
nput parameters, which can have any value, including missing, they needn't be evaluated. Best regards, Emil Bode Data-analyst +31 6 43 83 89 33 emil.b...@dans.knaw.nl DANS: Netherlands Institute for Permanent Access to Digital Research Resources Anna van Saksenlaan 51 | 2593 HW Den Haag | +31 7

Re: [Rd] Buglet in handling times in R-3.5.1

2018-10-09 Thread Emil Bode
regards, Emil Bode On 09/10/2018, 17:27, "R-devel on behalf of Russell, George" wrote: Dear R developers, I have found a minute bug in R-3.5.1 (Windows version), about how times not an exact number of seconds are displayed. > as.POSIXct("1969-01-01 01:00&q

Re: [Rd] Warning when calling formals() for `[`.

2018-10-08 Thread Emil Bode
" And note that if there is a dispatch, it's possible to get the argument-list of a specific method, e.g. args(`[.data.frame`) works as expected (as it is not a primitive) Best regards, Emil Bode On 07/10/2018, 16:34, "R-devel on behalf of Rui Barradas" wrote: Hello,

[Rd] Relevel confusing with numeric value

2018-10-02 Thread Emil Bode
if(is.numeric(ref) && any(!is.na(suppressWarnings(as.numeric(lev) warning('Provided numeric reference, note that this will promote the ', ref, 'th value, not level with value "', ref, '"!') Best regards, Emil Bode Data-analyst +31 6 43 83 89 33 emil.b...@dans.knaw.nl<m

Re: [Rd] future time stamps warning

2018-09-20 Thread Emil Bode
On Thu, Sep 20, 2018 at 11:46 AM Leo Lahti wrote: > > Time stamps are correct and my system time is correct. How is your timezone set? When I look at your github I see as timestamp for DESCRIPTION today, 1:25 PM GMT+2. (and as I'm writing this, it's 1:12 PM GMT+2) GMT+2 is CEST,

Re: [Rd] A different error in sample()

2018-09-20 Thread Emil Bode
that this also holds for non-integer n. The most important thing is why people would use sample with a non-integer x, I don’t see many use cases. So I agree with Luke that a warning would be best, regardless of what the docs say. Best regards, Emil Bode Although it seems to be pretty weird to en

Re: [Rd] Bug when calling system/system2 (and request for Bugzilla account)

2018-09-14 Thread Emil Bode
ere are you sending the interrupt signal with ^C? Best, luke On Fri, 14 Sep 2018, Emil Bode wrote: > Hi all, > > I found some strange behaviour, which I think is a bug. Could someone make an account for me on Bugzilla or pass on my report? > >

[Rd] Bug when calling system/system2 (and request for Bugzilla account)

2018-09-14 Thread Emil Bode
ituation) My setup: R 3.5.1 (Feather Spray), run with –vanilla option GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin17) macOS High Sierra 10.13.6 Best regards, Emil Bode Data-analyst +31 6 43 83 89 33 emil.b...@dans.knaw.nl<mailto:emil.b...@dans.knaw.nl> DANS: Netherlands In

Re: [Rd] Modification-proposal for %% (modulo) when supplied with double

2018-09-13 Thread Emil Bode
p 11, 2018 at 12:11:29PM -0400, Duncan Murdoch wrote: > On 11/09/2018 11:23 AM, Emil Bode wrote: > > Hi all, > > > > > > > > Could we modify the "%%" (modulo)-operator to include some tolerance for rounding-errors when s

[Rd] Modification-proposal for %% (modulo) when supplied with double

2018-09-11 Thread Emil Bode
Hi all, Could we modify the "%%" (modulo)-operator to include some tolerance for rounding-errors when supplied with doubles? It's not much work (patch supplied on the bottom), and I don't think it would break anything, only if you were really interested in analysing rounding differences.

Re: [Rd] compairing doubles

2018-08-31 Thread Emil Bode
Agreed that's it's rounding error, and all.equal would be the way to go. I wouldn't call it a bug, it's simply part of working with floating point numbers, any language has the same issue. And while we're at it, I think the function can be a lot shorter: .is_continous_evenly_spaced <-

Re: [Rd] ROBUSTNESS: x || y and x && y to give warning/error if length(x) != 1 or length(y) != 1

2018-08-31 Thread Emil Bode
where I'd use || or && outside an if-statement, so I'd rather have the current behaviour, because I'm not sure if I'm reliant on logical(0) || TRUE somewhere in my code (even though that would be ugly code, it's not wrong per se) But I could always rewrite it, so I believe it's more a question of how much would have to be rewritten. Maybe implement it first in devel, to see how many people would complain? Emil Bode __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] ROBUSTNESS: x || y and x && y to give warning/error if length(x) != 1 or length(y) != 1

2018-08-30 Thread Emil Bode
Okay, I thought you always wanted to check the length, but if we can only check what's evaluated I mostly agree. I still think there's not much wrong with how length-0 logicals are treated, as the return of NA in cases where the value matters is enough warning I think, and I can imagine some

Re: [Rd] ROBUSTNESS: x || y and x && y to give warning/error if length(x) != 1 or length(y) != 1

2018-08-30 Thread Emil Bode
throws a warning (or an error for a length-0 or NA result). I get it that for someone just starting in R, the differences between | and || can be confusing, but I guess that's just the price to pay for having a vectorized language. Best regards, Emil Bode Data-analyst +31 6 43 83 89 33

Re: [Rd] validspamobject?

2018-08-15 Thread Emil Bode
you can catch it. Best regards, Emil Bode is an institute of the Dutch Academy KNAW <http://knaw.nl/nl> and funding organisation NWO <http://www.nwo.nl/>. On 15/08/2018, 02:57, "R-devel on behalf of Ronald Barry" wrote: Greetings, My R package has

Re: [Rd] apply with zero-row matrix

2018-07-30 Thread Emil Bode
f view, R is mostly a functional programming language, I think if you want side-effects a for-loop would look better. Best regards, Emil Bode Data-analyst +31 6 43 83 89 33 emil.b...@dans.knaw.nl DANS: Netherlands Institute for Permanent Access t

Re: [Rd] oddity in transform

2018-07-24 Thread Emil Bode
u can always change the column-names later. Best regards, Emil Bode Data-analyst +31 6 43 83 89 33 emil.b...@dans.knaw.nl DANS: Netherlands Institute for Permanent Access to Digital Research Resources Anna van Saksenlaan 51 | 2593 HW Den Haag | +31 70 349 44 50 | i...@dans.knaw.nl <ma

[Rd] write.table with quote=TRUE fails on nested data.frames

2018-07-05 Thread Emil Bode
es = NA, sep = ";", dec = ",", qmethod = "double") The “four;five;six” string is stored unquoted, so read.table (or read.csv) breaks down. This also affects write.csv and write.csv2, but I’ve written a patch, See here-under. Anyone who could file this for me? Be

[Rd] Inconsistencies when extracting with non-integer numeric indices near zero

2018-07-03 Thread Emil Bode
ut for other cases I think we need to change the underlying code, or at the very least update documentation. Any thoughts? Best regards, Emil Bode Data-analyst +31 6 43 83 89 33 emil.b...@dans.knaw.nl<mailto:emil.b...@dans.knaw.nl> DANS: Netherlands Institute for Permanent Access to

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

2018-06-12 Thread Emil Bode
as.Date(Inf, origin='1970-01-01') [1] "Date with numerical value Inf" Warning message: In format.Date(x) : Some dates are not in the interval 01-01-01 and -12-31, showing numerical value. From: Gabe Becker Date: Monday, 11 June 2018 at 23:59 To: Emil Bode Cc: Joris Meys , Wer

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

2018-06-11 Thread Emil Bode
nt(print.Date) <- .GlobalEnv x <- as_date(Inf, origin='1970-01-01') print(x) # [1] "Invalid date: Inf" Best regards, Emil Bode Data-analyst +31 6 43 83 89 33 emil.b...@dans.knaw.nl DANS: Netherlands Institute for Permanent Access to Digital Research Resources Anna van Saksenlaan