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


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


source







All Articles