Commit 089fccf2 by Eric Coissac

adds a function to test if an object is a procrust model (`pm`)

parent 89dc07f6
......@@ -35,6 +35,15 @@ pm.fit = function(covmat,y,xs,
.ctrace <- function(MAT) sum(MAT^2)
#' Tests that the object is as `pm` instance.
#'
#' @author Eric Coissac
#' @author Christelle Gonindard-Melodelima
#' @export
is.pm = function(obj) {
inherits(obj, "pm")
}
#' Performs a procruste model on a set of coordinate matrices
#'
#' @author Eric Coissac
......@@ -94,6 +103,7 @@ pm = function (formula,data, subset, weights, na.action, method = "qr",
z$A <- NULL
}
else {
vars <- vars.procmod(mt, mf)
nvars=ncol(vars)
irep = attr(vars,"response")
......@@ -105,6 +115,8 @@ pm = function (formula,data, subset, weights, na.action, method = "qr",
vars.norm = as.procmod.frame(mapply(function(x) scale(x,scale = FALSE),
vars,
SIMPLIFY = FALSE))
if (is.null(w)) {
subset.w=rep(TRUE,nvars)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment