[FLR-list] R bug !?

Ernesto Jardim ernesto.jardim at gmail.com
Sat Jan 14 23:12:20 CET 2012


On Fri, Jan 13, 2012 at 3:36 PM, Laurie Kell <lauriekell at googlemail.com>wrote:

> 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
>

Yes, I'm doing it _because_ the conversion exists. But that's not the major
point. Why is.infinite(iris$Sepal.Length) works and
apply(iris,2,is.infinite) doesn't ?

EJ


> 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>
>>
>
> _______________________________________________
> flr-list mailing list
> flr-list at flr-project.org
> 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/20120114/b64d9313/attachment.htm>


More information about the flr-list mailing list