I have a set of data (x1, x2, x3.....). From that, I need to select that particular data which is just below given data, say (X) in R The following sample and code give the value of X as 44.75. I need to write a select code that will select 43 from the dataset.
sample <- c(20,25,30,24,27,33,18,26,43, 57)
a <- (quantile(sample, 0.75))
b <- (quantile(sample, 0.25))
X <- a + 1.5*(a-b)
select <-