Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

mean

Arithmetic Mean


Description

The arithmetic mean of an expression.

Usage

## S3 method for class 'Expression'
mean(x, trim = 0, na.rm = FALSE, ...)

Arguments

x

An Expression object.

trim

(Unimplemented) The fraction (0 to 0.5) of observations to be trimmed from each end of x before the mean is computed.

na.rm

(Unimplemented) A logical value indicating whether missing values should be removed.

...

(Unimplemented) Optional arguments.

Value

An Expression representing the mean of the input.

Examples

A <- Variable(2,2)
val <- cbind(c(-5,2), c(-3,1))
prob <- Problem(Minimize(mean(A)), list(A == val))
result <- solve(prob)
result$value

CVXR

Disciplined Convex Optimization

v1.0-10
Apache License 2.0 | file LICENSE
Authors
Anqi Fu [aut, cre], Balasubramanian Narasimhan [aut], David W Kang [aut], Steven Diamond [aut], John Miller [aut], Stephen Boyd [ctb], Paul Kunsberg Rosenfield [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.