Skip to content
Prev 324404 / 398503 Next

Subset a floating point vector using all.equal?

Hello,

You can write a helper function.

are.equal <- function(x, y, eps = .Machine$double.eps^0.5) abs(x - y) < eps

x[are.equal(x, 0.15)]


Hope this helps,

Rui Barradas

Em 30-05-2013 02:27, Peter Lomas escreveu: