R/dist2matrix.R

Defines functions dist2matrix

###########################
## Transform dist object to a matrix using fast and efficiant C code
###########################

dist2matrix <- function(dist) {
	if (inherits(dist, "dist")) {
		return(.Call(C_dist2matrix, as.double(dist), attr(dist, "Size")))
	}
	else if (is.matrix(dist)) {
		return(dist)
	}
	stop("dist should be a matrix or a \"dist\" object")
}

Try the TraMineR package in your browser

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

TraMineR documentation built on Sept. 19, 2023, 1:07 a.m.