[R] Finding cases in one subset that are closet to another subset

Peter Flom peterflomconsulting at mindspring.com
Wed Dec 2 21:54:20 CET 2009


David Winsemius <dwinsemius at comcast.net> wrote
>
>On Dec 2, 2009, at 3:01 PM, Peter Flom wrote:
>
>> Good afternoon
>>
>> Running R2.10.0 on Windows
>>
>> I have a data frame that includes (among much else) a factor  
>> (In_2006) and a continuous variable (math_3_4).  I would like to  
>> find the 2 cases for In_2006 = 0 that are closest to each case where  
>> In_2006 = 1.
>>
>
>You ask for closest which would imply a singleton, but you also ask  
>for cases (plural). Define "closest", please.


I would like the 2 closest cases .... that is, for each case in one set, the two that are closest in the other set.

Sorry if I was not clear

Peter

Peter L. Flom, PhD
Statistical Consultant
Website: www DOT peterflomconsulting DOT com
Writing; http://www.associatedcontent.com/user/582880/peter_flom.html
Twitter:   @peterflom




More information about the R-help mailing list