Re: [R] Strange behaviour of sapply function.

2019-09-12 Thread bickis
Thanks.You are right. I have realized that the atv function returns empty for negative arguments. I was not aware that this would affect how sapply processes its result. > > Quoting bic...@math.usask.ca: > >> Here is are a few lines of my R session: >> >>> class(income) >> [1] "integer" >>>

Re: [R] Strange behaviour of sapply function.

2019-09-12 Thread Enrico Schumann
Quoting bic...@math.usask.ca: 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 expecte

Re: [R] Strange behaviour of sapply function.

2019-09-12 Thread Eric Berger
Can you create a reproducible example? You don't show: income, atv, sktaxb, sktax On Thu, Sep 12, 2019 at 12:04 PM wrote: > 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*inc

Re: [R] Strange behaviour of sapply function.

2019-09-12 Thread Jim Lemon
Hi bickis, Putting on my dark glasses and flailing about with a big white stick*, I would suggest that you look at what "atv" actually produces from those three objects. I wouldn't be surprised to find quite different things. Jim * blind guess On Thu, Sep 12, 2019 at 7:04 PM wrote: > > Here is a

[R] Strange behaviour of sapply function.

2019-09-12 Thread bickis
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