R: Create a Named Vector

named_vector {mlr3misc} | R Documentation

## Create a Named Vector

### Description

Creates a simple atomic vector with `init` as values.

### Usage

    named_vector(nn = character(0L), init = NA)

### Arguments

`nn` | (`character()`) Names of new vector
`init` | (`atomic`) All vector elements are initialized to this value.

### Value

(named `vector()`).

### Examples

    named_vector(c("a", "b"), NA)
    named_vector(character())

[Package mlr3misc version 0.9.5 Index]