new-vector

0th

Percentile

Create vectors matching a given length

These functions construct vectors of given length, with attributes specified via dots. Except for new_list() and new_bytes(), 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
new_logical(n, names = NULL)

new_integer(n, names = NULL)

new_double(n, names = NULL)

new_character(n, names = NULL)

new_complex(n, names = NULL)

new_raw(n, names = NULL)

new_list(n, names = NULL)

Arguments
n

The vector length.

names

Names for the new vector.

See Also

new-vector-along

Aliases
  • new-vector
  • new_logical
  • new_integer
  • new_double
  • new_character
  • new_complex
  • new_raw
  • new_list
Examples
library(rlang) # NOT RUN { new_list(10) new_logical(10) # }
Documentation reproduced from package rlang, version 0.2.0, License: GPL-3

Community examples

Looks like there are no examples yet.