groupsum: Extension of 'rowsum'

Description Usage Arguments Value Author(s) See Also

View source: R/groupsum.R

Description

groupsum extends rowsum: it allows group to be an array of the same shape as x.

Usage

1
2
3
4
5
6
7
8
9
groupsum(
  x,
  group = NULL,
  dim = 1L,
  reorder = TRUE,
  na.rm = FALSE,
  ...,
  drop = !is.array(x)
)

Arguments

x

array to be rowsummed

group

grouping variable (integer or factor) indicating groups of samples.

dim

along which dimension should the group sums be taken? (default: rows)

reorder

should the groups be ordered? see rowsum

na.rm

shoud NAs be removed?

...

ignored

drop

should 1d arrays drop to vectors?

Value

like rowsum, but further dimensions of the array are preserved.

Author(s)

Claudia Beleites

See Also

rowsum rowsum


arrayhelpers documentation built on Feb. 4, 2020, 5:06 p.m.