[FLR-list] bug in areaSums

Iago Mosqueira iago.mosqueira-sanchez at jrc.ec.europa.eu
Mon Feb 27 09:07:51 CET 2012


On 02/25/2012 11:50 PM, Clara Ulrich wrote:
> Hi,
>
> I found a bug in the basic method areaSums, which sum applies only on dim 1:4 instead of c(1:4,6).
>
> flq<- FLQuant(rnorm(4000), dim=c(5,10,2,2,2,10), quant='age')
>>   dim(quantSums(flq))
> [1]  1 10  2  2  2 10
>>   dim(areaSums(flq))
> [1]  5 10  2  2  1  1
>>   dim(yearSums(flq))
> [1]  5  1  2  2  2 10
>>   dim(unitSums(flq))
> [1]  5 10  1  2  2 10
>>   dim(seasonSums(flq))
> [1]  5 10  2  1  2 10
>>   dim(areaSums(flq))
> [1]  5 10  2  2  1  1
>
>> selectMethod("areaSums",signature="FLQuant")
> Method Definition:
> function (x, ...)
> {
>      .local<- function (x, na.rm = TRUE)
>      {
>          return(apply(x, c(1:4), sum, na.rm = na.rm))
>      }
>      .local(x, ...)
> }
> <environment: namespace:FLCore>
> Signatures:
>          x
> target  "FLQuant"
> defined "FLQuant"
>
>
> areaVars and areaMeans are correct.
>
> Cheers
> Clara
> _______________________________________________
> flr-list mailing list
> flr-list at flr-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/flr-list

Hi,

Many thanks. Now fixed in revision 1572 of FLCore.Just goes to show how 
little work by area has been done so far ...



Iago

-- 
Dr Iago Mosqueira

European Commission – Joint Research Center
Institute for the Protection and Security of the Citizen (IPSC)
Maritime Affairs Unit FISHREG – Scientific Support to Fisheries
TP 051, Via Enrico Fermi 2749
I-21027 Ispra (VA), Italy

Office : +39 0332 785413
Fax: +39 0332 789658

iago.mosqueira at jrc.ec.europa.eu

http://fishreg.jrc.ec.europa.eu/home



More information about the flr-list mailing list