bySum: Fast conditional sum

Description Usage Arguments Value Examples

View source: R/bySum.R

Description

bySum works like a very fast version of tapply with (weighted) FUN=sum.

Usage

1
bySum(x, by, na.rm = FALSE, weight = NULL, ...)

Arguments

x

numeric vector to be summed

by

(list of) factor(s) for which the sum will be calculated

na.rm

logical If TRUE NA values will be removed

weight

numeric with of same length as x

...

not used

Value

array with dimensions of by

Examples

1
2

Example output

Loading required package: ff
Loading required package: bit
Attaching package bit
package:bit (c) 2008-2012 Jens Oehlschlaegel (GPL-2)
creators: bit bitwhich
coercion: as.logical as.integer as.bit as.bitwhich which
operator: ! & | xor != ==
querying: print length any all min max range sum summary
bit access: length<- [ [<- [[ [[<-
for more help type ?bit

Attaching package: 'bit'

The following object is masked from 'package:base':

    xor

Attaching package ff
- getOption("fftempdir")=="/work/tmp/tmp/RtmpSm0c1Z"

- getOption("ffextension")=="ff"

- getOption("ffdrop")==TRUE

- getOption("fffinonexit")==TRUE

- getOption("ffpagesize")==65536

- getOption("ffcaching")=="mmnoflush"  -- consider "ffeachflush" if your system stalls on large writes

- getOption("ffbatchbytes")==16777216 -- consider a different value for tuning your system

- getOption("ffmaxbytes")==536870912 -- consider a different value for tuning your system


Attaching package: 'ff'

The following objects are masked from 'package:bit':

    clone, clone.default, clone.list

The following objects are masked from 'package:utils':

    write.csv, write.csv2

The following objects are masked from 'package:base':

    is.factor, is.ordered


Attaching package: 'ffbase'

The following objects are masked from 'package:ff':

    [.ff, [.ffdf, [<-.ff, [<-.ffdf

The following objects are masked from 'package:base':

    %in%, table

  A   B 
838 682 
    tension
wool   L   M   H
   A 401 216 221
   B 254 259 169

ffbase documentation built on Feb. 27, 2021, 5:06 p.m.