Skip to contents

A constant is an object the value of which cannot be altered once assigned.

Usage

const(name, value)

Arguments

name

a symbol, the name to be assigned to the constant.

value

any valid R object, including a function

Value

Returns argument value invisibly (via invisible(value)).

Details

See reference.

Examples

(const(bar, "irish"))
#> [1] "irish"

try(bar <- "bavarian")
#> Error in try(bar <- "bavarian") : 
#>   cannot change value of locked binding for 'bar'