R/copy.R

Defines functions copy_matrix copy_vector

copy_matrix <- function(x, c_type)
{
  m <- NROW(x)
  n <- NCOL(x)
  y <- matrix(0, m, n)
  y[seq_len(m), seq_len(n)] <- x
  storage.mode(y) <- c_type
  y
}


copy_vector <- function(x, c_type)
{
  n <- length(x)
  y <- double(n)
  y[seq_len(n)] <- x
  storage.mode(y) <- c_type
  y
}

Try the lmeVarComp package in your browser

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

lmeVarComp documentation built on May 2, 2019, 8:55 a.m.