Just to update this
f[35.99,36.22] works fine  and returns the data from f[35,36] it does this 
rounding the R itself.

the problem finally was a value f[0.99,3] that was returning numeric(0) which I 
understand as a matrix doesnot have  any f[0,0]

Regards
Alex


--- On Thu, 11/18/10, Sarah Goslee <sarah.gos...@gmail.com> wrote:

From: Sarah Goslee <sarah.gos...@gmail.com>
Subject: Re: [R] why help ignores some values
To: "Alaios" <ala...@yahoo.com>
Cc: "Rhelp" <r-help@r-project.org>
Date: Thursday, November 18, 2010, 11:27 AM

Possibly because R has no idea what the 35.999999999999872-th
element of a matrix is?

However you are coming up with these elements, you are running
into a floating-point arithmetic problem (FAQ 7.31). Using
round() might help.

Sarah

On Thu, Nov 18, 2010 at 6:19 AM, Alaios <ala...@yahoo.com> wrote:
> Please take a look at the values below
> .................
> [31,] 30.000000000000000 30.000000000000000
> [32,] 31.000000000000000 31.000000000000000
> [33,] 32.000000000000000 32.000000000000000
> [34,] 33.000000000000000 33.000000000000000
> [35,] 34.000000000000000 34.000000000000000
> [36,] 35.000000000000000 35.000000000000000
> [37,] 35.999999999999872 35.999999999999872
>
>
> These are entries in an array. These values are used as indexes inside a 
> matrix.
> f[shweights[37,1],shweights[37,2]] works fine for me and returns correctly 
> the value.
>
> but when I try
> f[shweights[,1],shweights[,2]]
> I only get 36 out of 37 results (seems that in that case ignores the last 
> values, 37th)
> .....
> [35,]  2.7245297165175781
> [36,]  2.7245297165175781
>
> Why this might be happening?
> Regards
> Alex
>
>


-- 
Sarah Goslee
http://www.functionaldiversity.org



      
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to