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

Details

See reference.

See also

Examples

const(bar, "irish")
bar
#> [1] "irish"
try(bar <- "bavarian")
#> Error in try(bar <- "bavarian") : 
#>   cannot change value of locked binding for 'bar'