Thanks, Martin. I missed the duplication. My apology -- old age is
asserting it's presence.
Then my response is: I think the documentation is correct as written:
> a <- matrix(rep(1:3,2), nr=3)
> a
[,1] [,2]
[1,]11
[2,]22
[3,]33
> duplicated(a)
[1] FALSE FALSE FALSE
> Bert Gunter
> on Thu, 9 May 2019 08:46:15 -0700 writes:
> Juan:
> No, I think there may be a bug:
>> duplicated(array(c(1,2,3,2,5,6),c(3,2)), MARGIN=1:2)
> [,1] [,2]
> [1,] FALSE TRUE
> [2,] FALSE FALSE
> [3,] FALSE FALSE
> ## This is wrong
>
Juan:
No, I think there may be a bug:
> duplicated(array(c(1,2,3,2,5,6),c(3,2)), MARGIN=1:2)
[,1] [,2]
[1,] FALSE TRUE
[2,] FALSE FALSE
[3,] FALSE FALSE
## This is wrong
## But if we first define the array...
> a <- array(c(1,2,3,4,5,6), c(3,2))
> duplicated(a, MARGIN = 1:2)
[,1] [
I think there is an error in duplicated() help page when it states that:
"The array method calculates for each element of the sub-array
specified by MARGIN if the remaining dimensions are identical to those
for an earlier (or later, when fromLast = TRUE) element (in row-major
order). "
Instead of:
4 matches
Mail list logo