Commit 44b6d649 by Eric Coissac

Rename procmod.frame to multivariate.data.frame

parent 9e0b4755
......@@ -21,9 +21,9 @@ Suggests:
VignetteBuilder: knitr
Collate:
'internals.R'
'procmod.frame.R'
'multivariate.data.frame.R'
'multivariate.R'
'formula.procmod.frame.R'
'formula.multivariate.data.frame.R'
'omit.action.R'
'model.procmod.R'
'mprocuste.R'
......
# Generated by roxygen2: do not edit by hand
S3method("$<-",procmod.frame)
S3method("[",procmod.frame)
S3method("[[<-",procmod.frame)
S3method("$<-",multivariate.data.frame)
S3method("[",multivariate.data.frame)
S3method("[[<-",multivariate.data.frame)
S3method(AIC,pm)
S3method(BIC,pm)
S3method(anova,pm)
S3method(as.data.frame,dist)
S3method(as.list,procmod.frame)
S3method(as.procmod.frame,array)
S3method(as.procmod.frame,list)
S3method(as.procmod.frame,pm)
S3method(as.procmod.frame,procmod.frame)
S3method(as.list,multivariate.data.frame)
S3method(as.multivariate.data.frame,array)
S3method(as.multivariate.data.frame,list)
S3method(as.multivariate.data.frame,multivariate.data.frame)
S3method(as.multivariate.data.frame,pm)
S3method(deviance,pm)
S3method(dim,procmod.frame)
S3method(dim,multivariate.data.frame)
S3method(extractAIC,pm)
S3method(formula,procmod.frame)
S3method(na.exclude,procmod.frame)
S3method(na.omit,procmod.frame)
S3method(formula,multivariate.data.frame)
S3method(na.exclude,multivariate.data.frame)
S3method(na.omit,multivariate.data.frame)
S3method(ortho,data.frame)
S3method(ortho,dist)
S3method(ortho,matrix)
S3method(ortho,procmod.frame)
S3method(ortho,multivariate.data.frame)
S3method(plot,pm)
S3method(print,pm)
S3method(project,data.frame)
S3method(project,dist)
S3method(project,matrix)
S3method(project,procmod.frame)
S3method(project,multivariate.data.frame)
S3method(residuals,pm)
S3method(subset,procmod.frame)
export(as.procmod.frame)
S3method(subset,multivariate.data.frame)
export(as.multivariate.data.frame)
export(bicenter)
export(covv)
export(covv2)
export(is.euclid)
export(is.multivariate.data.frame)
export(is.pm)
export(is.procmod.frame)
export(model.procmod.default)
export(multivariate.data.frame)
export(nmds)
export(ortho)
export(pca)
export(pcoa)
export(pm)
export(procmod.frame)
export(project)
export(protate)
export(rv)
......
#' @include procmod.frame.R
#' @include multivariate.data.frame.R
#' @include multivariate.R
#'
NULL
......@@ -33,20 +33,20 @@ NULL
Xs <- list(...)
if (length(Xs)==1) {
x = Xs[[1]]
if (is.procmod.frame(x))
if (is.multivariate.data.frame(x))
Xs=x
else if (is.pm(x))
return(x$cov)
else
Xs=procmod.frame(x)
Xs=multivariate.data.frame(x)
}
else
Xs=as.procmod.frame(Xs)
Xs=as.multivariate.data.frame(Xs)
Xnames=names(Xs)
Xs <- project(Xs)
Xs <- as.procmod.frame(mapply(tcrossprod,
Xs <- as.multivariate.data.frame(mapply(tcrossprod,
Xs,
SIMPLIFY = FALSE))
......
#' @include internals.R
NULL
#' Build a formula from a procmod.frame.
#' Build a formula from a multivariate.data.frame.
#'
#' @author Eric Coissac
#' @author Christelle Gonindard-Melodelima
#' @export
formula.procmod.frame = function (x, ...)
formula.multivariate.data.frame = function (x, ...)
{
nm <- sapply(names(x), as.name)
......@@ -18,7 +18,7 @@ formula.procmod.frame = function (x, ...)
rhs <- nm[1L]
lhs <- NULL
}
else stop("cannot create a formula from an empty procmod.frame")
else stop("cannot create a formula from an empty multivariate.data.frame")
ff <- parse(text = paste(lhs,
paste(rhs,
......
#' @include internals.R
#' @include omit.action.R
#' @include procmod.frame.R
#' @include formula.procmod.frame.R
#' @include multivariate.data.frame.R
#' @include formula.multivariate.data.frame.R
#' @include multivariate.R
#'
NULL
......@@ -82,7 +82,7 @@ NULL
data$row.names=row.names
data = do.call(ProcMod::procmod.frame,data)
data = do.call(ProcMod::multivariate.data.frame,data)
if (! is.null(subset) ) {
......@@ -105,7 +105,7 @@ NULL
ans = do.call(na.action,list(data))
if ( !is.procmod.frame(ans) ||
if ( !is.multivariate.data.frame(ans) ||
length(ans) != length(data))
stop("invalid result from na.action")
......@@ -130,7 +130,7 @@ model.procmod.default = function (formula,
...)
{
possible_newdata = !missing(data) &&
is.procmod.frame(data) &&
is.multivariate.data.frame(data) &&
identical(substitute(data),
quote(newdata)) &&
(nr = nrow(data)) > 0
......@@ -162,13 +162,13 @@ model.procmod.default = function (formula,
if (missing(formula))
{
if (!missing(data) &&
inherits(data, "procmod.frame") &&
inherits(data, "multivariate.data.frame") &&
length(attr(data, "terms")))
return(data)
formula <- as.formula(data)
}
else if (missing(data) &&
inherits(formula, "procmod.frame"))
inherits(formula, "multivariate.data.frame"))
{
if (length(attr(formula, "terms")))
return(formula)
......@@ -189,12 +189,12 @@ model.procmod.default = function (formula,
if (missing(data))
data <- environment(formula)
else if (!is.procmod.frame(data) &&
else if (!is.multivariate.data.frame(data) &&
!is.environment(data) &&
!is.null(attr(data, "class")))
data <- as.procmod.frame(data)
data <- as.multivariate.data.frame(data)
else if (is.array(data))
data <- as.procmod.frame(data)
data <- as.multivariate.data.frame(data)
if (!inherits(formula, "terms"))
formula <- terms(formula, data = data)
......
......@@ -112,7 +112,7 @@ pm = function (formula,data, subset, weights, na.action, method = "qr",
variances= diag(data.cov)
std.dev = sqrt(variances)
vars.norm = as.procmod.frame(mapply(function(x) scale(x,scale = FALSE),
vars.norm = as.multivariate.data.frame(mapply(function(x) scale(x,scale = FALSE),
vars,
SIMPLIFY = FALSE))
......@@ -124,7 +124,7 @@ pm = function (formula,data, subset, weights, na.action, method = "qr",
else {
sw = sqrt(w)
vars.norm = as.procmod.frame(lapply(vars.norm, function(v) v * sw))
vars.norm = as.multivariate.data.frame(lapply(vars.norm, function(v) v * sw))
subset.w = sw > 0
vars.norm = vars.norm[subset.w,]
......
#' @include procmod.frame.R
#' @include multivariate.data.frame.R
#' @import MASS
#'
NULL
......@@ -136,7 +136,7 @@ is.euclid = function (distances, tol = 1e-07)
}
is.orthogonal = function(x) {
stopifnot(is.procmod.frame(x))
stopifnot(is.multivariate.data.frame(x))
return(!is.null(attr(x,'projected')))
}
......@@ -189,7 +189,7 @@ ortho.data.frame = function(x,scale=FALSE) {
#' @author Eric Coissac
#' @author Christelle Gonindard-Melodelima
#' @export
ortho.procmod.frame = function(x) {
ortho.multivariate.data.frame = function(x) {
if (is.orthogonal(x))
return(x)
......@@ -253,7 +253,7 @@ project.data.frame = function(x,scale=FALSE) {
#' @author Eric Coissac
#' @author Christelle Gonindard-Melodelima
#' @export
project.procmod.frame = function(x) {
project.multivariate.data.frame = function(x) {
n = ncol(x)
for (i in seq_len(n)) {
......
......@@ -140,12 +140,12 @@ NULL
}
#' The procmod.frame data structure.
#' The multivariate.data.frame structure.
#'
#' @author Eric Coissac
#' @author Christelle Gonindard-Melodelima
#' @export
procmod.frame = function(...,
multivariate.data.frame = function(...,
row.names = NULL,
check.rows = FALSE,
check.names = TRUE,
......@@ -209,25 +209,25 @@ procmod.frame = function(...,
for (i in seq_len(n))
.siteNames(value[[i]])=NULL
return(make_subS3Class(value, "procmod.frame"))
return(make_subS3Class(value, "multivariate.data.frame"))
}
#'
#' Check if an object is a ProcMod Frame.
#'
#' @rdname procmod.frame
#' @rdname multivariate.data.frame
#' @export
is.procmod.frame = function(x) {
inherits(x, "procmod.frame")
is.multivariate.data.frame = function(x) {
inherits(x, "multivariate.data.frame")
}
#'
#' Coerce to a ProcMod Frame.
#'
#' @rdname procmod.frame
#' @rdname multivariate.data.frame
#' @export
as.procmod.frame = function(data,...) {
UseMethod("as.procmod.frame",data)
as.multivariate.data.frame = function(data,...) {
UseMethod("as.multivariate.data.frame",data)
}
#' Coerce to a ProcMod Frame.
......@@ -235,9 +235,9 @@ as.procmod.frame = function(data,...) {
#' @author Eric Coissac
#' @author Christelle Gonindard-Melodelima
#' @export
as.procmod.frame.list = function(data,...) {
as.multivariate.data.frame.list = function(data,...) {
data=c(data,list(...))
do.call(procmod.frame,data)
do.call(multivariate.data.frame,data)
}
#' Coerce to a ProcMod Frame.
......@@ -245,7 +245,7 @@ as.procmod.frame.list = function(data,...) {
#' @author Eric Coissac
#' @author Christelle Gonindard-Melodelima
#' @export
as.procmod.frame.procmod.frame = function(data,...) {
as.multivariate.data.frame.multivariate.data.frame = function(data,...) {
data
}
......@@ -254,7 +254,7 @@ as.procmod.frame.procmod.frame = function(data,...) {
#' @author Eric Coissac
#' @author Christelle Gonindard-Melodelima
#' @export
as.procmod.frame.array = function(data,...) {
as.multivariate.data.frame.array = function(data,...) {
di = dim(data)
stopifnot(length(di)==3)
......@@ -266,7 +266,7 @@ as.procmod.frame.array = function(data,...) {
data=c(l,list(...))
do.call(procmod.frame,l)
do.call(multivariate.data.frame,l)
}
#' Coerce to a ProcMod Frame.
......@@ -274,7 +274,7 @@ as.procmod.frame.array = function(data,...) {
#' @author Eric Coissac
#' @author Christelle Gonindard-Melodelima
#' @export
as.procmod.frame.pm = function(data,...) {
as.multivariate.data.frame.pm = function(data,...) {
vars.procmod(terms(data),data$model)
}
......@@ -283,13 +283,13 @@ as.procmod.frame.pm = function(data,...) {
#' @author Eric Coissac
#' @author Christelle Gonindard-Melodelima
#' @export
dim.procmod.frame = function(x)
dim.multivariate.data.frame = function(x)
return(c(.siteCount(x[[1]]),length(x)))
#' @author Eric Coissac
#' @author Christelle Gonindard-Melodelima
#' @export
`[[<-.procmod.frame` = function (x, i, value)
`[[<-.multivariate.data.frame` = function (x, i, value)
{
cl = class(x)
nrows=.siteCount(x)
......@@ -324,7 +324,7 @@ dim.procmod.frame = function(x)
#' @author Eric Coissac
#' @author Christelle Gonindard-Melodelima
#' @export
`$<-.procmod.frame` = function (x, name, value) {
`$<-.multivariate.data.frame` = function (x, name, value) {
x[[name]] <- value
return(x)
}
......@@ -332,7 +332,7 @@ dim.procmod.frame = function(x)
#' @author Eric Coissac
#' @author Christelle Gonindard-Melodelima
#' @export
`[.procmod.frame` = function (x, i, j,
`[.multivariate.data.frame` = function (x, i, j,
drop = TRUE)
{
has.j = !missing(j)
......@@ -373,7 +373,7 @@ dim.procmod.frame = function(x)
if (drop && length(y)==1L)
y = y[[1]]
else {
y = make_subS3Class(y, "procmod.frame")
y = make_subS3Class(y, "multivariate.data.frame")
attr(y,"row.names")=rownames(y[[1]])
}
......@@ -383,7 +383,7 @@ dim.procmod.frame = function(x)
#' @author Eric Coissac
#' @author Christelle Gonindard-Melodelima
#' @export
subset.procmod.frame = function (x, subset, select, drop = FALSE, ...)
subset.multivariate.data.frame = function (x, subset, select, drop = FALSE, ...)
{
r <- if (missing(subset))
rep_len(TRUE, nrow(x))
......@@ -407,7 +407,7 @@ subset.procmod.frame = function (x, subset, select, drop = FALSE, ...)
#' @author Eric Coissac
#' @author Christelle Gonindard-Melodelima
#' @export
as.list.procmod.frame = function(x, ...) {
as.list.multivariate.data.frame = function(x, ...) {
class(x)='list'
return(x)
}
#' @author Eric Coissac
#' @author Christelle Gonindard-Melodelima
#' @export
na.omit.procmod.frame=function (object, ...)
na.omit.multivariate.data.frame=function (object, ...)
{
n <- length(object)
omit <- logical(nrow(object))
......@@ -23,8 +23,8 @@ na.omit.procmod.frame=function (object, ...)
#' @author Eric Coissac
#' @author Christelle Gonindard-Melodelima
#' @export
na.exclude.procmod.frame=function(object, ...) {
xx = na.omit.procmod.frame(object, ...)
na.exclude.multivariate.data.frame=function(object, ...) {
xx = na.omit.multivariate.data.frame(object, ...)
na.action = attr(xx, "na.action")
if (! is.null(na.action)) {
class(na.action)="exclude"
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/procmod.frame.R
\name{as.procmod.frame.array}
\alias{as.procmod.frame.array}
% Please edit documentation in R/multivariate.data.frame.R
\name{as.multivariate.data.frame.array}
\alias{as.multivariate.data.frame.array}
\title{Coerce to a ProcMod Frame.}
\usage{
\method{as.procmod.frame}{array}(data, ...)
\method{as.multivariate.data.frame}{array}(data, ...)
}
\description{
Coerce to a ProcMod Frame.
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/procmod.frame.R
\name{as.procmod.frame.list}
\alias{as.procmod.frame.list}
% Please edit documentation in R/multivariate.data.frame.R
\name{as.multivariate.data.frame.list}
\alias{as.multivariate.data.frame.list}
\title{Coerce to a ProcMod Frame.}
\usage{
\method{as.procmod.frame}{list}(data, ...)
\method{as.multivariate.data.frame}{list}(data, ...)
}
\description{
Coerce to a ProcMod Frame.
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/procmod.frame.R
\name{as.procmod.frame.pm}
\alias{as.procmod.frame.pm}
% Please edit documentation in R/multivariate.data.frame.R
\name{as.multivariate.data.frame.multivariate.data.frame}
\alias{as.multivariate.data.frame.multivariate.data.frame}
\title{Coerce to a ProcMod Frame.}
\usage{
\method{as.procmod.frame}{pm}(data, ...)
\method{as.multivariate.data.frame}{multivariate.data.frame}(data, ...)
}
\description{
Coerce to a ProcMod Frame.
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/procmod.frame.R
\name{as.procmod.frame.procmod.frame}
\alias{as.procmod.frame.procmod.frame}
% Please edit documentation in R/multivariate.data.frame.R
\name{as.multivariate.data.frame.pm}
\alias{as.multivariate.data.frame.pm}
\title{Coerce to a ProcMod Frame.}
\usage{
\method{as.procmod.frame}{procmod.frame}(data, ...)
\method{as.multivariate.data.frame}{pm}(data, ...)
}
\description{
Coerce to a ProcMod Frame.
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/procmod.frame.R
\name{dim.procmod.frame}
\alias{dim.procmod.frame}
% Please edit documentation in R/multivariate.data.frame.R
\name{dim.multivariate.data.frame}
\alias{dim.multivariate.data.frame}
\title{Dimensions of a Matrix Frame.}
\usage{
\method{dim}{procmod.frame}(x)
\method{dim}{multivariate.data.frame}(x)
}
\description{
Dimensions of a Matrix Frame.
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/formula.procmod.frame.R
\name{formula.procmod.frame}
\alias{formula.procmod.frame}
\title{Build a formula from a procmod.frame.}
% Please edit documentation in R/formula.multivariate.data.frame.R
\name{formula.multivariate.data.frame}
\alias{formula.multivariate.data.frame}
\title{Build a formula from a multivariate.data.frame.}
\usage{
\method{formula}{procmod.frame}(x, ...)
\method{formula}{multivariate.data.frame}(x, ...)
}
\description{
Build a formula from a procmod.frame.
Build a formula from a multivariate.data.frame.
}
\author{
Eric Coissac
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/procmod.frame.R
% Please edit documentation in R/multivariate.data.frame.R
\name{.procmod_coerce_value}
\alias{.procmod_coerce_value}
\title{Internal function coercing the data to a matrix.}
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/procmod.frame.R
% Please edit documentation in R/multivariate.data.frame.R
\name{.rep_matrix}
\alias{.rep_matrix}
\title{Internal function repeating a matrix.}
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/procmod.frame.R
\name{procmod.frame}
\alias{procmod.frame}
\alias{is.procmod.frame}
\alias{as.procmod.frame}
\title{The procmod.frame data structure.}
% Please edit documentation in R/multivariate.data.frame.R
\name{multivariate.data.frame}
\alias{multivariate.data.frame}
\alias{is.multivariate.data.frame}
\alias{as.multivariate.data.frame}
\title{The multivariate.data.frame structure.}
\usage{
procmod.frame(..., row.names = NULL, check.rows = FALSE,
multivariate.data.frame(..., row.names = NULL, check.rows = FALSE,
check.names = TRUE, reorder.rows = FALSE, contrasts.arg = NULL)
is.procmod.frame(x)
is.multivariate.data.frame(x)
as.procmod.frame(data, ...)
as.multivariate.data.frame(data, ...)
}
\description{
The procmod.frame data structure.
The multivariate.data.frame structure.
Check if an object is a ProcMod Frame.
......
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