R/copy.R

"copy<-" <- function(object,...,value) UseMethod("copy<-")
"copy<-.lvm" <- function(object,...,value) {
  if (class(value)[1]=="formula") {
    value <- all.vars(value)
  }
  if (length(value)<2) stop("Provide name of new variable")
  
  regression(object,value[-1],value[1]) <- 1
  covariance(object,value[-1]) <- 0  
  intercept(object,value[-1]) <- 0
  return(object)
}

Try the lava package in your browser

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

lava documentation built on May 2, 2019, 4:49 p.m.