R/auxiliary_list_to_matrix.R

Defines functions list_to_matrix

# This is a function to transform a list of vectors of the same length into a matrix

list_to_matrix <- function(l){
  n <- length(l)
  s <- length(l[[1]])
  m <- base::matrix(nrow = n, ncol = s)
  for (i in 1 : n) {
    m[i,] <- l[[i]]
  }
  m
}

Try the ctsfeatures package in your browser

Any scripts or data that you put into this service are public.

ctsfeatures documentation built on May 29, 2024, 11:37 a.m.