R/sp3.R

Defines functions sp3

Documented in sp3

sp3 <- function(X=X, win=sphwin(type="sphere"), check=TRUE) {
	stopifnot(ncol(X)==3 && inherits(win,"sphwin"))
	if(check) {
		stopifnot(in.W(points=X, win=win))
		n <- nrow(X)
		pointrad <- (X[,1]^2)+(X[,2]^2)+(X[,3]^2)
		rad1 <- rep(win$rad, n)
		stopifnot(sum(sround(rad1-pointrad)) <= 0)
	}
	result <- list(X=X, win=win)
	class(result) <- c("sp3", class(result))
	result
}
baddstats/spherstat documentation built on Feb. 6, 2023, 1:45 a.m.