Methods to compute totals over selected dimensions of FLQuant objects These methods return an object of same dimensions as the input but with the sums along the first (yearTotals) or second dimension (quantTotals). Although the names might appear contradictory, it must be noted that what each method really returns are the totals over the selected dimension.

quantTotals(x, ...)

Generic function

quantTotals(x)

yearTotals(x)

See also

FLQuant

Examples

flq <- FLQuant(rlnorm(100), dim=c(10,10)) quantTotals(flq)
#> An object of class "FLQuant" #> , , unit = unique, season = all, area = unique #> #> year #> quant 1 2 3 4 5 6 7 8 9 #> 1 19.5334 19.5334 19.5334 19.5334 19.5334 19.5334 19.5334 19.5334 19.5334 #> 2 10.2647 10.2647 10.2647 10.2647 10.2647 10.2647 10.2647 10.2647 10.2647 #> 3 15.8299 15.8299 15.8299 15.8299 15.8299 15.8299 15.8299 15.8299 15.8299 #> 4 15.0893 15.0893 15.0893 15.0893 15.0893 15.0893 15.0893 15.0893 15.0893 #> 5 14.7519 14.7519 14.7519 14.7519 14.7519 14.7519 14.7519 14.7519 14.7519 #> 6 8.8959 8.8959 8.8959 8.8959 8.8959 8.8959 8.8959 8.8959 8.8959 #> 7 9.9711 9.9711 9.9711 9.9711 9.9711 9.9711 9.9711 9.9711 9.9711 #> 8 8.7213 8.7213 8.7213 8.7213 8.7213 8.7213 8.7213 8.7213 8.7213 #> 9 10.3687 10.3687 10.3687 10.3687 10.3687 10.3687 10.3687 10.3687 10.3687 #> 10 13.6346 13.6346 13.6346 13.6346 13.6346 13.6346 13.6346 13.6346 13.6346 #> year #> quant 10 #> 1 19.5334 #> 2 10.2647 #> 3 15.8299 #> 4 15.0893 #> 5 14.7519 #> 6 8.8959 #> 7 9.9711 #> 8 8.7213 #> 9 10.3687 #> 10 13.6346 #> #> units: NA
# See how the values obtained by yearSums are being replicated yearSums(flq)
#> An object of class "FLQuant" #> , , unit = unique, season = all, area = unique #> #> year #> quant 1 #> 1 19.5334 #> 2 10.2647 #> 3 15.8299 #> 4 15.0893 #> 5 14.7519 #> 6 8.8959 #> 7 9.9711 #> 8 8.7213 #> 9 10.3687 #> 10 13.6346 #> #> units: NA
# Get the proportions by quant flq / quantTotals(flq)
#> An object of class "FLQuant" #> , , unit = unique, season = all, area = unique #> #> year #> quant 1 2 3 4 5 6 7 #> 1 0.1401071 0.1583094 0.0401853 0.0249691 0.0108168 0.3613267 0.0885698 #> 2 0.0151625 0.1813932 0.0880427 0.1116723 0.0790881 0.0478386 0.1216403 #> 3 0.2039503 0.0883486 0.0327350 0.0717524 0.0268496 0.0163921 0.1915459 #> 4 0.0192638 0.0552537 0.1906328 0.0460857 0.1185448 0.0205035 0.0634216 #> 5 0.0678793 0.3615079 0.0143622 0.0558853 0.2123546 0.0484294 0.0096503 #> 6 0.0586736 0.0261403 0.2642581 0.0244212 0.1333874 0.1066911 0.1033863 #> 7 0.1855691 0.0988805 0.0795930 0.2046823 0.0632667 0.0177282 0.0941209 #> 8 0.1004544 0.1007954 0.0909422 0.0591549 0.1345026 0.1407439 0.1019978 #> 9 0.0106053 0.1566371 0.1647681 0.1478087 0.0738273 0.2032565 0.1262801 #> 10 0.0356085 0.0364308 0.2737919 0.0561311 0.3786550 0.0386520 0.0439539 #> year #> quant 8 9 10 #> 1 0.0701616 0.0740334 0.0315208 #> 2 0.1991795 0.0795452 0.0764376 #> 3 0.1407386 0.1773844 0.0503032 #> 4 0.2988539 0.0146999 0.1727404 #> 5 0.0349267 0.0410645 0.1539396 #> 6 0.0358815 0.0929460 0.1542145 #> 7 0.0904860 0.1073780 0.0582952 #> 8 0.1958534 0.0432136 0.0323416 #> 9 0.0479634 0.0539373 0.0149163 #> 10 0.0296527 0.0472286 0.0598954 #> #> units: NA
# or year flq / yearTotals(flq)
#> An object of class "FLQuant" #> , , unit = unique, season = all, area = unique #> #> year #> quant 1 2 3 4 5 6 7 #> 1 0.2431213 0.1847497 0.0534919 0.0520990 0.0138202 0.5106992 0.1470325 #> 2 0.0138261 0.1112410 0.0615857 0.1224442 0.0531003 0.0355313 0.1061138 #> 3 0.2868062 0.0835561 0.0353129 0.1213288 0.0278008 0.0187759 0.2576924 #> 4 0.0258223 0.0498113 0.1960234 0.0742817 0.1170014 0.0223864 0.0813307 #> 5 0.0889553 0.3186149 0.0144382 0.0880633 0.2049046 0.0516946 0.0120987 #> 6 0.0463679 0.0138931 0.1601992 0.0232062 0.0776149 0.0686761 0.0781632 #> 7 0.1643744 0.0589051 0.0540830 0.2180077 0.0412629 0.0127907 0.0797589 #> 8 0.0778279 0.0525196 0.0540492 0.0551087 0.0767278 0.0888174 0.0756000 #> 9 0.0097686 0.0970329 0.1164235 0.1637092 0.0500706 0.1524955 0.1112780 #> 10 0.0431301 0.0296763 0.2543929 0.0817511 0.3376964 0.0381330 0.0509318 #> year #> quant 8 9 10 #> 1 0.0945249 0.1542400 0.0598906 #> 2 0.1410127 0.0870864 0.0763194 #> 3 0.1536602 0.2994926 0.0774566 #> 4 0.3110253 0.0236577 0.2535391 #> 5 0.0355366 0.0646112 0.2208934 #> 6 0.0220155 0.0881885 0.1334437 #> 7 0.0622291 0.1141959 0.0565405 #> 8 0.1178097 0.0401969 0.0274363 #> 9 0.0343008 0.0596494 0.0150442 #> 10 0.0278853 0.0686814 0.0794362 #> #> units: NA