Learn R Programming

lsr (version 1.0.0)

who: Contents of workspace

Description

Prints a summary of all objects in the workspace, showing each object's name, class, and size.

Usage

who(expand = FALSE)

Value

Prints the workspace summary and invisibly returns the underlying data (a data frame with columns Name, Class, and Size), which can be assigned to a variable and inspected if needed.

Arguments

expand

Set to TRUE to also list the variables inside any data frames in the workspace. Defaults to FALSE.

Details

Shows each object's name, class, and size. For objects with explicit dimensions (e.g., data frames, matrices) the size is shown as rows x columns; for other objects it is the length. Size is only shown for objects whose mode is numeric, character, logical, complex, or list.

Shows more information than objects (especially for variables inside data frames) but less detail than ls.str.

See Also

Examples

Run this code
cats <- 4
mood <- "happy"
who()

dataset <- data.frame(
  hi = c("hello", "cruel", "world"),
  pi = c(3, 1, 4)
)

who()
who(expand = TRUE)

Run the code above in your browser using DataLab