Re: [R] max and pmax of NA and NaN

2018-01-19 Thread Suharto Anggono Suharto Anggono via R-help
Extremes.Rd, that documents 'max' and 'pmax', has this in "Details" section, in the paragraph before the last. By definition the min/max of a numeric vector containing an NaN is NaN, except that the min/max of any vector containing an NA is NA even if it also contains an NaN. --

Re: [R] Another way to count TRUE

2017-06-07 Thread Suharto Anggono Suharto Anggono via R-help
, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Wed, Jun 7, 2017 at 9:33 AM, Suharto Anggono Suharto Anggono via R-h

[R] Another way to count TRUE

2017-06-07 Thread Suharto Anggono Suharto Anggono via R-help
To get the number of TRUE in logical vector 'x', tabulate(x, 1) can be used. Actually, it gives count of 1, but TRUE as integer is 1. Since R 3.4.0, it gives a correct answer, too, when the count is 2^31 or more. __ R-help@r-project.org mailing list --

[R] aggregate.data.frame(drop=FALSE) in R 3.3.0

2016-05-14 Thread Suharto Anggono Suharto Anggono via R-help
>From NEWS: The data frame and formula methods for aggregate() gain a drop >argument. Here, I highlight behavior of 'aggregate.data.frame' with drop=FALSE in R 3.3.0. Example 1, modified from "example with character variables and NAs" in "Example" in R help on 'aggregate': > testDF <- data.fram

Re: [R] For logical i and length(i) > length(x), x[i] <- value makes length(x) == length(i)

2015-09-13 Thread Suharto Anggono Suharto Anggono via R-help
2 I no longer have access to a running version of Splus 3.4, but it does not look like a feature we would have changed. Bill Dunlap TIBCO Software wdunlap tibco.com On Sat, Sep 12, 2015 at 9:17 AM, Suharto Anggono Suharto Anggono via R-help wrote: > I'll make my points clearer.

Re: [R] For logical i and length(i) > length(x), x[i] <- value makes length(x) == length(i)

2015-09-12 Thread Suharto Anggono Suharto Anggono via R-help
.OO#. rocks...1k --------------- Sent from my phone. Please excuse my brevity. On September 5, 2015 10:02:05 AM PDT, Suharto Anggono Suharto Anggono via R-help <[hidden email]> wrote: >I came across this behavior when I fol

[R] For logical i and length(i) > length(x), x[i] <- value makes length(x) == length(i)

2015-09-05 Thread Suharto Anggono Suharto Anggono via R-help
I came across this behavior when I followed the code of function 'rank' in R. It seems that subassignment of a vector by a logical index vector that is longer than the original vector always results in expanding the original vector to the length of the index vector. The resulting length may be