intermingle2vec: intermingle2vec

View source: R/CodeAndRoll2.R

intermingle2vecR Documentation

intermingle2vec

Description

Combine 2 vectors (of the same length) so that form every odd and every even element of a unified vector.

Usage

intermingle2vec(V1, V2, wNames = TRUE, name_prefix = NULL)

Arguments

V1

A vector.

V2

A vector.

wNames

Logical. Whether to include the names of the vectors in the output vector.

name_prefix

A character vector of length 2. If provided, the names of the vectors will be prefixed with the corresponding element of name_prefix.

Value

A vector that combines V1 and V2, with the elements of V1 alternating with the elements of V2.

Examples

V1 <- c(1, 3, 5)
V2 <- c(2, 4, 6)
intermingle2vec(V1, V2)


vertesy/CodeAndRoll2 documentation built on Nov. 20, 2024, 5:23 a.m.