list_objects | R Documentation |
This function lists all data and function objects in the current R environment. It can sort the data objects by name or size and display their sizes in a readable format.
list_objects(sort_by = "name", display = "both")
sort_by |
A character string specifying the sort order for data objects. Can be "name" (default) or "size". |
display |
A character string specifying which objects to display. Can be "both" (default), "data", or "functions". |
Prints the names and sizes of data and function objects in the current environment, and the total size of all data objects.
## Not run:
# Create some example data objects and functions
x <- 1:10
y <- data.frame(a = 1:5, b = 6:10)
z <- "Hello, world!"
my_func <- function(x) { x + 1 }
# Print objects sorted by name
list_objects()
# Print data objects sorted by size
list_objects(sort_by = "size")
# Print only data objects sorted by name
list_objects(display = "data")
# Print only functions sorted by name
list_objects(display = "functions")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.