How does one identify Inf
, -Inf
when 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 this does not seem very safe.
How does one identify Inf
, -Inf
when 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 this does not seem very safe.
Try this:
> sqldf("select val from x where cast(val as text) != 'Inf'")
val
1 1
2 2
3 3