[R] Strange behaviour of sapply function.

bickis m@iii@g oii m@th@us@sk@c@ bickis m@iii@g oii m@th@us@sk@c@
Wed Sep 11 22:51:26 CEST 2019


Here is are a few lines of my R session:

> class(income)
[1] "integer"
> class(sapply(1000*income-999,atv,sktaxb,sktax))
[1] "numeric"
> class(sapply(1000*income-1001,atv,sktaxb,sktax))
[1] "list"

Although "income" is a numeric array, and sapply works as expected
returning an array (the function "atv" returns a single numeric argument),
if subtract a large enough number from the first argument, the sapply
function now wants to return a list?   Am I missing something?

I am running version 3.3.2 on Mac OS 10.9.9



More information about the R-help mailing list