This looks like R FAQ 7.31, the one so commonly asked that regulars on
this list have its number memorized!
> tau<-seq(0.02,0.98,0.02)
> match(round(0.12, 2), round(tau, 2))
[1] 6
> match(round(0.16, 2), round(tau, 2))
[1] 8
See also ?all.equal
Sarah
On Mon, Nov 4, 2013 at 1:29 PM, Timo Schmid
R FAQ 7.31 .
-- Bert
On Mon, Nov 4, 2013 at 10:29 AM, Timo Schmid wrote:
> Hello,
> I want to match specific numbers and a vector. Therefore I use the match or
> which function but I get unreasonable results. Has anybody an idea why I got
> a NA inmatch(0.12, tau)Please see the code below:
>
>
Hello,
I want to match specific numbers and a vector. Therefore I use the match or
which function but I get unreasonable results. Has anybody an idea why I got a
NA inmatch(0.12, tau)Please see the code below:
> tau<-seq(0.02,0.98,0.02)
> tau
[1] 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.
3 matches
Mail list logo