From 2a6ba4a9d3aaa340af8517593e31333728d12ac8 Mon Sep 17 00:00:00 2001 From: cfhammill Date: Tue, 3 Jan 2017 13:58:20 -0500 Subject: [PATCH] add anatModel printer --- NAMESPACE | 1 + R/minc_anatomy.R | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/NAMESPACE b/NAMESPACE index cd7165c8..19443912 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -17,6 +17,7 @@ S3method(plot,bic_obj) S3method(plot,obj_mesh) S3method(print,RMINC_MASKED_VALUE) S3method(print,anatMatrix) +S3method(print,anatModel) S3method(print,mincLmer) S3method(print,mincLogLikRatio) S3method(print,mincMultiDim) diff --git a/R/minc_anatomy.R b/R/minc_anatomy.R index ed476386..843b9c64 100644 --- a/R/minc_anatomy.R +++ b/R/minc_anatomy.R @@ -367,6 +367,15 @@ print.anatMatrix <- function(x, n = min(6, nrow(x)), width = min(6, ncol(x)), .. invisible(x) } +#' @export +print.anatModel <- function(x, n = min(6, nrow(x)), width = min(6, ncol(x)), ...){ + cat("anatModel, showing ", n, " of ", nrow(x), " rows, and ", width, " of ", ncol(x), "columns\nprint more by supplying n and width to the print function\n") + sub_x <- x[seq_len(n), seq_len(width)] + + print(sub_x) + invisible(x) +} + #' Create Anatomy data.frame #' #' Convert an anatomy frame to data.frame for use with tidy tools