Re: [R] how to find the index of points selected from a scatter plot?

2012-09-03 Thread Bert Gunter
All good points. -- Bert On Mon, Sep 3, 2012 at 12:07 PM, Greg Snow <538...@gmail.com> wrote: > I would be very surprised if the x value from locator matched the x > value in the data to the precision needed by ==, and what if 2 points > have the same x-value but different y-values, you would ne

Re: [R] how to find the index of points selected from a scatter plot?

2012-09-03 Thread Greg Snow
I would be very surprised if the x value from locator matched the x value in the data to the precision needed by ==, and what if 2 points have the same x-value but different y-values, you would need to also check the y's. With appropriate rounding this would work, but would just be reinventing the

Re: [R] how to find the index of points selected from a scatter plot?

2012-08-31 Thread Peter Ehlers
On 2012-08-31 16:03, Bert Gunter wrote: ?which ## as in ix <- which(x==values) -- Bert Or maybe ?identify. Peter Ehlers On Fri, Aug 31, 2012 at 2:09 PM, Michael wrote: Hi all, I am using "locator" to select the points from a scatter plot... This is all fine. But the problem is that t

Re: [R] how to find the index of points selected from a scatter plot?

2012-08-31 Thread Bert Gunter
?which ## as in ix <- which(x==values) -- Bert On Fri, Aug 31, 2012 at 2:09 PM, Michael wrote: > Hi all, > > I am using "locator" to select the points from a scatter plot... > > This is all fine. > > But the problem is that the locator only returns the axis values of the > selected points. > >

[R] how to find the index of points selected from a scatter plot?

2012-08-31 Thread Michael
Hi all, I am using "locator" to select the points from a scatter plot... This is all fine. But the problem is that the locator only returns the axis values of the selected points. Instead, I would like to get the index of these select points... The axis values are real-values so it's a bit har

Re: [R] How to find the index

2008-09-17 Thread Greg Snow
ent: Tuesday, September 16, 2008 9:05 AM > To: r-help@r-project.org > Subject: [R] How to find the index > > Dear R experts, > >i have a vector z , i have to do something after z is sorted. how > can i find the original index, i.e., before sorting, of a certain > elemen

Re: [R] How to find the index

2008-09-16 Thread Don McKenzie
On 16-Sep-08, at 8:04 AM, Peng Jiang wrote: Dear R experts, i have a vector z , i have to do something after z is sorted. how can i find the original index, i.e., before sorting, of a certain element in the sorted vector . thanks in advance I use this function provided in the old "

Re: [R] How to find the index

2008-09-16 Thread Duncan Murdoch
On 9/16/2008 11:04 AM, Peng Jiang wrote: Dear R experts, i have a vector z , i have to do something after z is sorted. how can i find the original index, i.e., before sorting, of a certain element in the sorted vector . You can't. Sorting loses information, and the original index is

Re: [R] How to find the index

2008-09-16 Thread rkevinburton
I think if you use 'order' it will return the indexes of the array, sorted. Then you can get the original index back because the array will not be changed. Kevin Peng Jiang <[EMAIL PROTECTED]> wrote: > Dear R experts, i have a vector z , i have to do something after z is sorted. how

Re: [R] How to find the index

2008-09-16 Thread Henrik Bengtsson
See ?order, ?sort, and possibly match(). Pay attention to the arguments provided. /Henrik On Tue, Sep 16, 2008 at 8:04 AM, Peng Jiang <[EMAIL PROTECTED]> wrote: > Dear R experts, > > i have a vector z , i have to do something after z is sorted. how can i > find the original index, i.e., befor

[R] How to find the index

2008-09-16 Thread Peng Jiang
Dear R experts, i have a vector z , i have to do something after z is sorted. how can i find the original index, i.e., before sorting, of a certain element in the sorted vector . thanks in advance regards --- Peng Jiang 江鹏 ,Ph.D. Candidate