set_label: Attach a label to an expression

set_labelR Documentation

Attach a label to an expression

Description

CVXPY-parity setter that returns its first argument so calls can be chained (e.g. sum_squares(x) |> set_label("cost")). See format_labeled() for the pretty-printer that consumes labels.

Usage

set_label(x, value)

Arguments

x

An Expression object.

value

A label (character; coerced via as.character). Pass NULL to clear an existing label.

Value

x with the label updated.

See Also

label(), format_labeled()


CVXR documentation built on Aug. 24, 2026, 9:10 a.m.