new_rvec: Create a Blank Rvec

View source: R/constructors.R

new_rvecR Documentation

Create a Blank Rvec

Description

Create an rvec, consisting entirely of NAs, with a given length and number of draws.

Usage

new_rvec(x = double(), length = 0, n_draw = 1000)

Arguments

x

Object with the intended type. Default is double().

length

Desired length of rvec. Default is 0.

n_draw

Number of draws of rvec. Default is 1000.

Details

The type of the object is taken from x. If typeof(x) is "integer", for instance, then new_rvec() returns an object of class "rvec_int".

Value

An rvec.

See Also

  • rvec() rvec_chr(), rvec_dbl(), rvec_int(), rvec_lgl() Create an rvec from data.

  • n_draw() Query number of draws.

Examples

new_rvec()
new_rvec(TRUE, length = 3, n_draw = 100)

x <- new_rvec(length = 2)
x[1] <- rnorm_rvec(n = 1, n_draw = 1000)
x[2] <- runif_rvec(n = 1, n_draw = 1000)

rvec documentation built on Aug. 8, 2025, 7:29 p.m.