Skip to content

Commit

Permalink
add anatModel printer
Browse files Browse the repository at this point in the history
  • Loading branch information
cfhammill committed Jan 3, 2017
1 parent f0dac72 commit 2a6ba4a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 9 additions & 0 deletions R/minc_anatomy.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2a6ba4a

Please sign in to comment.