Identify Inf in sqldf
How to identify Inf
, -Inf
using SQL with sqldf
?
Sample data:
x <- data.frame(val = c(1, 2, 3, Inf))
Now I am using:
sqldf('select * from x where val < 999999999999999999999')
But it doesn't seem very safe.
+3
Tomas greif
source
to share
1 answer
Try the following:
> sqldf("select val from x where cast(val as text) != 'Inf'")
val
1 1
2 2
3 3
+3
G. Grothendieck
source
to share