new-vectors

0th

Percentile

Create new vectors.

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

Usage
new_lgl(.n = 0, ..., .attrs = list())
new_int(.n = 0, ..., .attrs = list())
new_dbl(.n = 0, ..., .attrs = list())
new_chr(.n = 0, ..., .attrs = list())
new_lst(.n = 0, ..., .attrs = list())
new_cpl(.n = 0, ..., .attrs = list())
new_raw(.n = 0, ..., .attrs = list())
Arguments
.n
The vector length.
...
A list of named attributes.
.attrs
A list of named attributes.
See Also

along

Aliases
  • new-vectors
  • new_lgl
  • new_int
  • new_dbl
  • new_chr
  • new_lst
  • new_cpl
  • new_raw
Examples
new_lst(10)

# Add attributes, including the S3 class:
new_int(0, index = 1)
new_dbl(10, class = "my_class")
Documentation reproduced from package rlang, version 0.0.0.9000, License: GPL-3

Community examples

Looks like there are no examples yet.