I have run into the same problem as described at R which () function returns integer(0)
price = seq(4,7, by=0.0025) allPrices = as.data.frame(price) lookupP
A manual approach to this involves specifying the tolerance for the comparison and doing:
# tol = 1e-7: comparison will be TRUE if numbers are equal up to # 7 decimal places tol = 1e-7 which(abs(allPrices$price - lookupPrice) < tol)