op-empty-default: Default value for empty vectors

Description Usage Arguments Examples

Description

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

Usage

1
x %0% y

Arguments

x

A vector

y

Value to use if x is empty. To preserve type-stability, should be the same type as x.

Examples

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

vctrs documentation built on April 29, 2021, 5:08 p.m.