[R] vector question
Andras Farkas
motyocska at yahoo.com
Mon Jun 17 20:29:34 CEST 2013
Dear All,
would you please help with the following:
let us say I have:
a <-c(0,1,12,13,24,25,36,37)
b <-c(6,24.6,27)
#then I extract every 2nd element from "a"
d <-a[seq(1, length(a), 2)]
and what I need help with is to extract the 1st value from d that is greater than the values in b, so as a result I should have "f" as:
f <-c(12,36,36)
appreciate the insights,
thank you,
Andras
More information about the R-help
mailing list