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

size-methods

Size Properties


Description

Determine if an expression is a scalar, vector, or matrix.

Usage

is_scalar(object)

is_vector(object)

is_matrix(object)

Arguments

object

An Expression object.

Value

A logical value.

Examples

x <- Variable()
y <- Variable(3)
z <- Variable(3,2)

is_scalar(x)
is_scalar(y)
is_scalar(x + y)

is_vector(x)
is_vector(y)
is_vector(2*z)

is_matrix(x)
is_matrix(y)
is_matrix(z)
is_matrix(z - x)

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.