Hi,
I'm having trouble with the "which" or the "seq" function, I'm not sure.
Here's an example :
> lat=seq(1,2,by=0.1)
> lat
[1] 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0
> which(lat==1)
[1] 1
> which(lat==1.1)
[1] 2
> which(lat==1.2)
[1] 3
> which(lat==1.3)
[1] 4
> which(lat==1.4)
[1]
Hej,
i need the which() funktion to find the positions of an entry in a matrix.
the entries i'm looking for are : seq(begin,end,0.01) and there are no
empty spaces
i'm searching in the right range.
so i was looking for the results R can find and i recieved this answer.
for (l in
1:length(qr)){p
Melanie Abecassis <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
> Hi,
> I'm having trouble with the "which" or the "seq" function, I'm not
> sure. Here's an example :
>
>
> > lat=seq(1,2,by=0.1)
> > lat
> [1] 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0
>
> > which(lat==1)
> [1] 1
> > w
G'day Melanie,
On Wed, 23 Apr 2008 17:46:56 -1000
Melanie Abecassis <[EMAIL PROTECTED]> wrote:
> This doesn't seem to happen with integers.
> Am I missing something ??
Yes, FAQ 7.31:
http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f
> Is there a
I have written a function that goes through a database and calculates various
metric scores and allocates them to a data set. For 400 of the 500 sites
that I calculate these metrics for works fine and allocates the scores into
the appropriate column. For some reason, some sites I run into the be
See R FAQ 7.31.
---
Jeff NewmillerThe . . Go Live...
DCN:Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research
Looks like you might be using vector addressing on a non-existent
object.
You have identified a column number, 14, to use. If you wanted to put
the XXX.table$Metric.name vector into a column of orig.metric.scores
(and it already existed with 10 rows), then you would would use matrix
sty
That would allocate, the vector down the column, correct? I should have
specified this clearer. I want to put each metric value into the
appropriate column (as designated by the metric name ) in a single row. My
data set SCORES.combined has the column headings for all potential metrics
that can
You probably want to use either '%in%' or 'match'. The result of 14
that you are getting is due to recycling of the shorter vector and
matching at the 14th position ("Insect-Tolerant").
On Wed, Feb 11, 2009 at 9:20 AM, Chrischizinski
wrote:
>
> I have written a function that goes through a datab
All it took was using 'match' instead of 'which'. Thanks for all your help!
--
View this message in context:
http://www.nabble.com/problem-with-%27which%27-and-strings-tp21955970p21958266.html
Sent from the R help mailing list archive at Nabble.com.
__
10 matches
Mail list logo