# Examples demonstrating object selection:
objects.summary() # all objects on working database
objects.summary("x") # just x on working database
objects.summary(c("x", "y"), where=2) # x and y on database 2
objects.summary(where=2, pattern="\\.old$")
# objects on database 2 whose names end in ".old"
objects.summary(mode="function")
# only functions on working database; storage.mode ok too
row.names(objects.summary(mode="function"))
# just char. vector of names of these functions
objects.summary(data.class=c("data.frame", "matrix"))
# only data frames and matrices on working database
objects.summary(data.class=c("data.frame", "matrix"), all.classes=T)
# catch objects that inherit from "data.frame" too
objects.summary(data.class="matrix", storage.mode="complex")
# only complex matrices on working database; i.e, the data
# class is "matrix" AND the storage mode is "complex"
all.obj <- objects.summary()
mat.index <- all.obj$data.class == "matrix"
cmplx.index <- all.obj$storage.mode == "complex"
all.obj[mat.index | cmplx.index, ]
# objects with data class "matrix" OR storage mode "complex"
# Examples demonstrating types of summary:
objects.summary() # all information
objects.summary(what="extent") # just extent (dim or length)
objects.summary(what=c("ext", "data.cl"))
# just ext[ent] and data.cl[ass]
objects.summary(order="object.size", reverse=T)
# all information; sort on object size, biggest first
objects.summary(order="object.size", reverse=T)[1:5, ]
# five biggest objects
os.date <- objects.summary(order="dataset.date", reverse=T)
# all info; sort objects on modif'n date, most recent first.
os.date[1:10, ]
# ten most recently modified objects; all info
os.date[1:10, c("extent", "data.class")]
# just these two components for those 10; note the component
# sorted on (earlier) is absent
objects.summary(ord="dataset.date",rev=T)[1:10, c("ext", "data.class")]
# same thing; note "dataset.date" was implicitly in the what
# argument so we could sort on it, then abandoned in subsetting
os.date[1:10, "extent", drop=F]
# just this one component for those 10; need drop=F to preserve
# data frame structure
objects.summary(order=c("data.class", "object.size"))
# sort on data class, and object size within data class
# Examples combining argument types:
objects.summary("x", c("data.class", "extent"))
# these 2 components for x on working database
objects.summary(storage.mode="logical", what="extent")
# get extent only, for logical data
objects.summary(where=2, mode="function", pattern=
"...............", what="dataset.date", order="dataset.date")
# select all functions on database 2 whose names are 15 or more
# characters long; return dataset date information, sorted
# on this date with earliest first
# print method
print(objects.summary(what="dataset.date", order="dataset.date"),
date.format=10)
# print only names and dataset dates, in the more detailed date
# format "Thu Oct 1 12:01:30 1992"; objects sorted on
# dataset date, earliest first