sum {matlab}R Documentation

MATLAB sum function

Description

Provides sum of elements.

Usage

sum(x, na.rm = FALSE)

Arguments

x numeric to be summed
na.rm logical. If TRUE, remove missing values

Details

This is an S4 generic function.

Value

Return value depends on argument x. If vector, returns the same as base::sum. If matrix, returns vector containing the sum of each column.

Author(s)

P. Roebuck, roebuck@mdanderson.org

Examples

sum(1:9)
sum(matrix(1:9, 3, 3))

[Package matlab version 0.7-6 Index]