Commit 8cb7d190 by Eric Coissac

renames function as.procmod_frame as_procmod_frame

parent b3ed8974
......@@ -87,7 +87,7 @@ corls.test <- function(...,
}
}
else {
xs <- as.procmod_frame(xs)
xs <- as_procmod_frame(xs)
}
x_names <- names(xs)
......@@ -117,7 +117,7 @@ corls.test <- function(...,
replace = FALSE
)
rcov = varls(as.procmod_frame(
rcov = varls(as_procmod_frame(
lapply(
1:nx,
function(j) xs[[j]][pmatrix[ps[j], ], ]
......
......@@ -165,7 +165,7 @@ varls <- function(...,
}
}
else {
xs <- as.procmod_frame(xs)
xs <- as_procmod_frame(xs)
}
x_names <- names(xs)
......
......@@ -330,26 +330,26 @@ is_procmod_frame <- function(x) {
#' @author Eric Coissac
#' @author Christelle Gonindard-Melodelima
#' @export
as.procmod_frame <- function(data, ...) {
UseMethod("as.procmod_frame", data)
as_procmod_frame <- function(data, ...) {
UseMethod("as_procmod_frame", data)
}
#' @rdname as.procmod_frame
#' @rdname as_procmod_frame
#' @export
as.procmod_frame.list <- function(data, ...) {
as_procmod_frame.list <- function(data, ...) {
data <- c(data, list(...))
do.call(procmod_frame, data)
}
#' @rdname as.procmod_frame
#' @rdname as_procmod_frame
#' @export
as.procmod_frame.procmod_frame <- function(data, ...) {
as_procmod_frame.procmod_frame <- function(data, ...) {
data
}
#' @rdname as.procmod_frame
#' @rdname as_procmod_frame
#' @export
as.procmod_frame.array <- function(data, ...) {
as_procmod_frame.array <- function(data, ...) {
di <- dim(data)
stopifnot(length(di) == 3)
......@@ -369,13 +369,13 @@ as.procmod_frame.array <- function(data, ...) {
# #' @rdname procmod_frame
# #' @export
# as.procmod_frame.pm <- function(data, ...) {
# as_procmod_frame.pm <- function(data, ...) {
# vars.procmod(terms(data), data$model)
# }
#' @rdname as.procmod_frame
#' @rdname as_procmod_frame
#' @export
as.procmod_frame.matrix <- function(data, ...) {
as_procmod_frame.matrix <- function(data, ...) {
l <- vector(mode = "list", length = ncol(data))
for (i in seq_len(ncol(data))) {
l[[i]] <- data[, i]
......@@ -385,7 +385,7 @@ as.procmod_frame.matrix <- function(data, ...) {
names(l) <- colnames(data)
}
as.procmod_frame(l)
as_procmod_frame(l)
}
#' Dimensions of 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