sim2tbl: Turn a data vector into a tibble

View source: R/sim2tbl.R

sim2tblR Documentation

Turn a data vector into a tibble

Description

Reshapes a simulation data vector into a matrix and converts it into a tibble.

Usage

sim2tbl(x, ncol = 1)

Arguments

x

Vector of data values

ncol

If integer, number of columns by which to split the vector. Use a negative value to duplicate the vector into a longer one-column tibble instead of splitting it. If integer vector, then each element in the x will be duplicated a number of times defined by its corresponding (positive) entry in ncol. So in this case, ncol and x must have the same length.

Value

A tibble containing the simulation data

See Also

read_data

Examples


sim2tbl(1:3)
sim2tbl(1:3, ncol = 3)
sim2tbl(1:3, ncol = -2)
sim2tbl(1:3, ncol = 1:3)


rscherrer/brachypoder documentation built on Oct. 2, 2024, 11:18 p.m.