Thank you for providing a reproducible example. I tweaked it a little
bit to make it actually a data frame problem.

There are lots of ways to do this; here's one approach.

On second thought, this looks a lot like homework, so perhaps instead
I'll just suggest using subset() with more than one condition.

Sarah

On Mon, Dec 9, 2013 at 3:27 PM, Andras Farkas <motyoc...@yahoo.com> wrote:
> Dear All
>
> please help with the following:
>
> I have:
>
> a <-seq(0,10,by=1)
> b <-c(10:20)
> d <-cbind(a,b)
> f <-16
>
> I would like to select the value in column a based on a value in column b, 
> where the value in column b is the 1st value that is smaller then f. Thus I 
> should end up with the number 5 because the 1st value that is below 16 would 
> be 15, and in the same row column a has the number 5....
>
> appreciate your insights,
>
> andras

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

______________________________________________
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