Skip to content

Commit

Permalink
Modify glimpse() methods
Browse files Browse the repository at this point in the history
Modify `glimpse()` methods for sample data and taxonomy tables to

- silently return the original object,
- first print the oneline summary from `oneline()` before running
  `tibble::glimpse()`, to make the phyloseq object type apparent in the
  output.

Fixes #77.
  • Loading branch information
mikemc committed Apr 21, 2024
1 parent 29cafd7 commit 0057652
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: speedyseq
Title: Faster implementations of phyloseq functions
Version: 0.5.3.9020
Version: 0.5.3.9021
Authors@R:
person(given = "Michael",
family = "McLaren",
Expand Down
4 changes: 4 additions & 0 deletions R/printing.R
Original file line number Diff line number Diff line change
Expand Up @@ -287,17 +287,21 @@ setMethod("oneline", "XStringSet", oneline.XStringSet)
#' @importFrom tibble glimpse
#' @export
glimpse.sample_data <- function(x, width = NULL, ...) {
cat(oneline(x), fill = TRUE)
x %>%
as("data.frame") %>%
tibble::glimpse(width = width, ...)
invisible(x)
}

#' @importFrom tibble glimpse
#' @export
glimpse.taxonomyTable <- function(x, width = NULL, ...) {
cat(oneline(x), fill = TRUE)
x %>%
as.data.frame %>%
tibble::glimpse(width = width, ...)
invisible(x)
}


0 comments on commit 0057652

Please sign in to comment.