R: Default value for empty vectors

%0% {vctrs} | R Documentation

## Default value for empty vectors

### Description

Use this inline operator when you need to provide a default value for empty (as defined by `vec_is_empty()`) vectors.

### Usage

    x %0% y

### Arguments

`x` | A vector
`y` | Value to use to `x` is empty. To preserve type-stability, should be the same type as `x`.

### Examples

    1:10 %0% 5
    integer() %0% 5

[Package vctrs version 0.2.2 Index]