[R] Strange behaviour of sapply function.
drj|m|emon @end|ng |rom gm@||@com
Thu Sep 12 11:25:31 CEST 2019
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
* blind guess
On Thu, Sep 12, 2019 at 7:04 PM <bickis using math.usask.ca> wrote:
> Here is are a few lines of my R session:
> > class(income)
>  "integer"
> > class(sapply(1000*income-999,atv,sktaxb,sktax))
>  "numeric"
> > class(sapply(1000*income-1001,atv,sktaxb,sktax))
>  "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
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help