[FLR-list] R bug !?

Laurie Kell lauriekell at googlemail.com
Fri Jan 13 15:36:03 CET 2012


You are summing up true and falses. So there is an implicit conversion from
logical to numeric.
I'm with Ripley (believe it or not) on this one.
To do it explicitly you could use function(x) sum(ifelse(x,1,0)))
Laurie
On Jan 13, 2012 2:10 PM, "Ernesto JARDIM" <ernesto.jardim at jrc.ec.europa.eu>
wrote:

> I'm afraid of mentioning the word ...
>
> Can you please check the code below on your installations ? It looks a bug
> but I'm sure Ripley wrote some where this is a new feature of apply ...
>
> data(iris)
> iris[1,1]<- Inf
>
> # this one should give 1 on the first column ..
> apply(apply(iris,2,is.**infinite),2,sum)
>
> sum(is.infinite(iris$Sepal.**Length))
>
> EJ
>
> --
> Ernesto Jardim<ernesto.jardim at jrc.ec.**europa.eu<ernesto.jardim at jrc.ec.europa.eu>
> >
> Scientific Officer
> FISHREG – Scientific Support to Fisheries
> IPSC Maritime Affairs Unit
> EC Joint Research Center
> TP 051, Via Enrico Fermi 2749
> I-21027 Ispra (VA), Italy
> Office : +39 0332 785311
> Fax: +39 0332 789658
> http://fishreg.jrc.ec.europa.**eu/ <http://fishreg.jrc.ec.europa.eu/>
>
>
>
> ______________________________**_________________
> flr-list mailing list
> flr-list at flr-project.org
> https://lists.r-forge.r-**project.org/cgi-bin/mailman/**listinfo/flr-list<https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/flr-list>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/flr-list/attachments/20120113/5c024d14/attachment.htm>


More information about the flr-list mailing list