Applies to both rows and columns, enabling quick inspection during interactive use.

headtail(x, ...)

# S4 method for atomic
headtail(x, n = 2L)

# S4 method for matrix
headtail(x, n = 2L, unicode = TRUE)

# S4 method for sparseMatrix
headtail(x, n = 2L, unicode = TRUE)

# S4 method for data.frame
headtail(x, n = 2L, unicode = TRUE)

# S4 method for DataFrame
headtail(x, n = 2L, unicode = TRUE)

# S4 method for GRanges
headtail(x, n = 2L, unicode = TRUE)

# S4 method for SummarizedExperiment
headtail(x, n = 2L, unicode = TRUE)

Arguments

x

Object.

n

integer(1). Positive integer denoting the number of first and last items to include.

unicode

logical(1). Allow Unicode characters in console output.

...

Additional arguments.

Value

Invisible NULL.

Details

Inspired by the print() method for DataFrame class objects.

Functions

  • headtail,atomic-method: Paste collapse to a character(1).

  • headtail,matrix-method: Show first and last rows.

  • headtail,sparseMatrix-method: Same method as matrix.

  • headtail,data.frame-method: Same method as matrix.

  • headtail,DataFrame-method: Same method as data.frame.

  • headtail,GRanges-method: Summarize the ranges.

  • headtail,SummarizedExperiment-method: Summarize the primary assay.

Note

Updated 2019-07-28.

See also

Examples

data(mtcars, package = "datasets") data(RangedSummarizedExperiment, package = "acidtest") rse <- RangedSummarizedExperiment ## data.frame ==== headtail(mtcars, unicode = TRUE)
#> mpg cyl │ gear carb #> Mazda RX4 21 6 │ 4 4 #> Mazda RX4 Wag 21 6 │ 4 4 #> ─ ─ ─ ┼ ─ ─ #> Maserati Bora 15 8 │ 5 8 #> Volvo 142E 21.4 4 │ 4 2
## SummarizedExperiment ==== headtail(rse, unicode = TRUE)
#> sample01 sample02 │ sample11 sample12 #> gene001 14 7 │ 2 0 #> gene002 19 8 │ 9 18 #> ─ ─ ─ ┼ ─ ─ #> gene499 87 30 │ 5 4 #> gene500 13 31 │ 35 31