__
> De : Chris Evans
> Envoyé : mardi 10 décembre 2019 15:41
> À : Alain Guillet
> Cc : r-help@r-project.org
> Objet : Re: [R] table and unique seems to behave differently
>
> This doesn't answer your question but I get exactly the same vector o
Thanks a lot, it answers my question.
Alain
De : Jeff Newmiller
Envoy� : mardi 10 d�cembre 2019 16:31
� : r-help@r-project.org ; Duncan Murdoch
; Alain Guillet ;
r-help@r-project.org
Objet : Re: [R] table and unique seems to behave differently
I think the
On 10/12/2019 10:32 a.m., Sarah Goslee wrote:
Back to the table part of the question, but using Duncan's example.
x <- c(3.4, 3.4 + 1e-15)
unique(x)
[1] 3.4 3.4
table(x)
x
3.4
2
The question was, why are these different.
table() only works on factors, so it converts the numeric vector t
c : r-help@r-project.org
Objet : Re: [R] table and unique seems to behave differently
This doesn't answer your question but I get exactly the same vector of length
210 with unique(toto) and names(table(toto)) using the same version of R that
you are and I can't see any obvious reason w
Back to the table part of the question, but using Duncan's example.
> x <- c(3.4, 3.4 + 1e-15)
> unique(x)
[1] 3.4 3.4
> table(x)
x
3.4
2
The question was, why are these different.
table() only works on factors, so it converts the numeric vector to a
factor before tabulation.
factor() tries to
I think the question was about table vs unique. Table groups by character
representation, unique groups by the underlying representation.
On December 10, 2019 7:03:34 AM PST, Duncan Murdoch
wrote:
>On 10/12/2019 3:53 a.m., Alain Guillet wrote:
>> Hi,
>>
>> I have a vector (see below the dput)
On 10/12/2019 3:53 a.m., Alain Guillet wrote:
Hi,
I have a vector (see below the dput) and I use unique on it to get unique values. If I
then sort the result of the vector obtained by unique, I see some elements that look like
identical. I suspect it could be a matter of rounded values but tab
This doesn't answer your question but I get exactly the same vector of length
210 with unique(toto) and names(table(toto)) using the same version of R that
you are and I can't see any obvious reason why you wouldn't but when I hit
things like that it tends to be that one version is string with i
8 matches
Mail list logo