Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

vec_init

Initialize a vector


Description

Initialize a vector

Usage

vec_init(x, n = 1L)

Arguments

x

Template of vector to initialize.

n

Desired size of result.

Dependencies

  • vec_slice()

Examples

vec_init(1:10, 3)
vec_init(Sys.Date(), 5)
vec_init(mtcars, 2)

vctrs

Vector Helpers

v0.3.8
MIT + file LICENSE
Authors
Hadley Wickham [aut], Lionel Henry [aut, cre], Davis Vaughan [aut], data.table team [cph] (Radix sort based on data.table's forder() and their contribution to R's order()), RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.