lsos: R Object List

lsosR Documentation

R Object List

Description

A better object list

Usage

lsos(pattern="", envir=NULL, pos = 1, order.by="Size",
decreasing=TRUE, head=TRUE, n=10,noShow="",exact=FALSE)

Arguments

pattern

character; the pattern to search for in the object list

envir

environment; the environment to list

pos

integer; environment position

order.by

character; field name to order object list by. Options are "Type", "Size", "PrettySize", "Rows", "Columns", "Value".

decreasing

logical; if TRUE, objects are listed in decreasing order

head

logical; if TRUE, only the first ‘n’ objects are listed

n

integer; number of items to list when ‘head’ is specified

noShow

character vector; fields to not show. Can be any combination of "type", "size", "pretty", "dim", "vals".

exact

logical; only show items that match 'pattern' exactly.

Details

A simple procedure to list objects matching ‘pattern’ in enviroment at ‘pos’, including details on objects type, size, and dimensions.

Value

data frame;

Type

Object class/type

Size

Size of the object (bits)

PrettySize

Size of the object in nearest major unit

Rows

Number of rows in the object

Columns

Number of columns in the object

Author(s)

Procedure was authored by Dirk Eddelbuettel and Tony Breyal in the StackOverflow Forum:

http://stackoverflow.com/questions/1358003/tricks-to-manage-the-available-memory-in-an-r-session

It has been modified by A.H.Wright.

Examples


#Load LAMBDAR
library(LAMBDAR)

#Add some things to the an environment
param.env<-new.env(parent=environment())
assign("x",runif(1),envir=param.env)
assign("y",runif(1E5),envir=param.env)
assign("z",runif(1E2),envir=param.env)
assign("string","Methinks it is like a weasel",envir=param.env)
assign("im",matrix(runif(1E6),1000,1000),envir=param.env)
assign("bigmat",matrix(runif(1E8),10000,10000),envir=param.env)

#Show the parameter space variables
lsos(envir=param.env)

#Only show the type and pretty size
lsos(envir=param.env, noShow=c("size","dim","vals"))


AngusWright/LAMBDAR documentation built on May 12, 2022, 1:49 a.m.