zatonovo / lambda.r

Functional programming in R
215 stars 14 forks source link

Type constraints that use numeric fail for integers #11

Closed muxspace closed 10 years ago

muxspace commented 11 years ago

The reason Is that an integer does not inherit from numeric in S3.

> class(as.integer(4))
[1] "integer"
> is.integer(as.integer(4))
[1] TRUE
> is.numeric(as.integer(4))
[1] TRUE

Instead what is needed is to convert a numeric reference to is.numeric(), the same way that Function maps to is.function().

muxspace commented 10 years ago

Fixed in 1.1.4