Learn R Programming

rlang (version 0.1.6)

vector-len: Create vectors matching a given length

Description

These functions construct vectors of given length, with attributes specified via dots. Except for list_len() and bytes_len(), the empty vectors are filled with typed missing values. This is in contrast to the base function base::vector() which creates zero-filled vectors.

Usage

lgl_len(.n)

int_len(.n)

dbl_len(.n)

chr_len(.n)

cpl_len(.n)

raw_len(.n)

bytes_len(.n)

list_len(.n)

Arguments

.n

The vector length.

See Also

vector-along

Examples

Run this code
# NOT RUN {
list_len(10)
lgl_len(10)
# }

Run the code above in your browser using DataLab