R/Diag.R

Defines functions `Diag<-` Diag

Documented in Diag

Diag <- function(x, ...) {
#Diag <- function(x, nrow, ncol) {
  if (inherits(x, "character") & missing(...)) {
    p <- length(x)
    out <- matrix(0, nrow=p, ncol=p)
    diag(out) <- x
  } else {
    out <- diag(x, ...)
    #out <- diag(x, nrow=nrow, ncol=ncol)
  }
  out
}

`Diag<-` <- function(x, value) {
  diag(x) <- value
  x
}

Try the metaSEM package in your browser

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

metaSEM documentation built on Sept. 30, 2024, 9:21 a.m.