Skip to contents

stm_stack_cols() combines multiple data frames or vectors by column binding them together using cbind().

Usage

stm_stack_cols(...)

Arguments

...

Data frames, matrices, or vectors to be combined as columns.

Value

A data frame or matrix resulting from column-wise binding of the input data.

Details

This function stacks the provided data frames, matrices, or vectors as columns using the cbind() function. The resulting object is returned as a data frame or matrix.

Examples

A <- matrix(1:4, nrow = 2, byrow = TRUE)
print(A)
#>      [,1] [,2]
#> [1,]    1    2
#> [2,]    3    4
B <- matrix(5:8, nrow = 2, byrow = TRUE)
print(B)
#>      [,1] [,2]
#> [1,]    5    6
#> [2,]    7    8
stm_stack_cols(A, B)
#>      [,1] [,2] [,3] [,4]
#> [1,]    1    2    5    6
#> [2,]    3    4    7    8