inspect_list: Inspect a list

View source: R/utils.R

inspect_listR Documentation

Inspect a list

Description

A useful function for exploratory work or when coding. Takes a list as an argument and prints a glimpse of the data contained in each list element and the dimensions of each list element. If the list contains more than 5 list elements, only the first 5 elements are printed to console with no warning. The function will print a maximum of 10 values if the list element is a vector and 10 rows and 5 columns if the list element is a matrix.

Usage

inspect_list(x)

Arguments

x

A list of vectors or matrices

Details

NOTE: There are currently no checks built in to handle a list of lists. In this case, everything in the sublists will be printed with no checks or warnings.

Examples

x <- list(
  matrix(runif(100), nrow = 20, ncol = 5),
  matrix(runif(100), nrow = 10, ncol = 10)
)

inspect_list(x)


edsandorf/cmdlR documentation built on Jan. 17, 2024, 12:33 a.m.