Keith Jewell said:
> ... from reading ?all.equal I would have expected
> scale = 1 and the default scale = NULL to give identical results for the
> length
> one numerics being passed to all.equal.
>
> Can anyone explain?
Inspectng the code in all.equal.numeric, I find
xy <- mean((if (cplx)
On 01/10/2014 23:54, Peter Alspach wrote:
Tena koe Kate
If kateDF is a data.frame with your data, then
apply(kateDF, 1, function(x) isTRUE(all.equal(x[2], x[1], check.attributes =
FALSE, tolerance=0.1)))
comes close to (what I think) you want (but not to what you have illustrated in
your 'ev
> > Is there an easy way to check whether a variable is within +/- 10%
> > range of another variable in R?
You could use
2*abs(A-B)/(A+B) < 0.1
which avoids an apply().
I've assumed you meant different by under 10% of the mean of the two, hence the
2/(A+B); if you meant 10% of something else, s
October 2014 12:39 p.m.
To: Peter Alspach
Cc: r-help
Subject: Re: [R] How to check to see if a variable is within a range of another
variable
Apologise - yes, my 10% calculations seem to be slightly off.
However, the function gives me all falses which seems to be a little
weird. Even wh
ate Ignatius
> Sent: Thursday, 2 October 2014 11:11 a.m.
> To: r-help
> Subject: [R] How to check to see if a variable is within a range of another
> variable
>
> Is there an easy way to check whether a variable is within +/- 10% range of
> another variable in R?
>
&g
be enough to allow you to get there.
HTH
Peter Alspach
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Kate Ignatius
Sent: Thursday, 2 October 2014 11:11 a.m.
To: r-help
Subject: [R] How to check to see if a variable is with
On Wed, Oct 1, 2014 at 3:11 PM, Kate Ignatius wrote:
> Is there an easy way to check whether a variable is within +/- 10%
> range of another variable in R?
Yes,
checkRange = function(A, B, range = 0.1)
{
A>=B*(1-range) & A<=B*(1+range);
}
Test:
A = c(67, 24, 40, 10, 70, 101, 9)
B = c(76, 23
Is there an easy way to check whether a variable is within +/- 10%
range of another variable in R?
Say, if I have a variable 'A', whether its in +/- 10% range of
variable 'B' and if so, create another variable 'C' to say whether it
is or not?
Is there a function that is able to do that?
eventua
8 matches
Mail list logo