objects.summary(names, what, where=1, frame,
pattern, regexpr.pattern, data.class, storage.mode,
mode="any", all.classes=F, order, reverse=F,
immediate=T)
print.objects.summary(x, date.format=11, ...)
Arguments are divided into those controlling the selection of objects to summarize, those controlling the nature and formatting of the summary information, and others.
The subset of objects from database
where or frame number
frame
which should be selected for summary is specified with either
an explicit vector of
names, or with some combination of the subsetting
criteria
pattern,
data.class,
storage.mode, and
mode. If
argument
names is given, the criteria are ignored. If more than one
criterion is given, only objects which satisfy all of them are selected.
In the absence of both
names and criteria,
all objects in
where or
frame are selected.
Detailed descriptions of the arguments follow.
0 for the session database. The default is the working database.
frame is given,
where is ignored.
grep.
Selects objects whose names match the pattern.
This argument now deprecated in favor of the
regexpr.pattern argument.
regexpr.
Selects objects whose names match the pattern.
all.classes=T, each element of
an object's class attribute is considered, not just the first.
These are used to specify what summary information is desired, and
how the entries for the objects should be sorted.
c("data.class", "storage.mode", "extent", "object.size", "dataset.date"),
in any order. The default is to return all five types of
information, in the order shown.
what is subject to partial matching, that is,
only enough initial letters of each string element are needed
to guarantee unique recognition.
data.class
and in the returned summary. This has bearing only on objects with a
class attribute. By default only the first class element is used.
order="object.size" means sort
the objects on the
object.size component of the summary. The elements
of
order can be any subset of the elements of
what except
"extent"; in addition,
"data.class" may not be requested in
order
if
all.classes=T.
order is subject to partial matching; thus
order="obj" means
order="object.size".
If
length(order) > 1, the second and succeeding elements are used to
break ties; see the
order function.
If
order is omitted, the entries are sorted alphabetically by object name.
TRUE, the final sort order is reversed, but only if
this order depends on something other than object names.
TRUE, objects in database
where are not retained in
the expression frame for the duration of the top-level expression (unless
they were there already). This
flag is
TRUE by default to keep memory growth down, though
FALSE could
improve evaluation time if objects from
where will be
accessed again during the same top-level expression. See
get for details.
dataset.date function:
1 for seconds since 1 January 1970 00:00 GMT,
10 for "Tue Sep 29 15:27:15 1992", and
11 for "92.09.29 15:27".
The default is the last of these.
name=value form, passed to
print.data.frame
and beyond.
"objects.summary", which inherits from class
"data.frame"
. Its components (printed as columns) are those specified in
argument
what. Each component contains one type of information for
all selected objects. They are at most the following.
all.classes=F), or a list of character vectors (if
all.classes=T
) containing the data class information.
This is defined as in the function
data.class, with the exception that
when
all.classes=T, the summary will contain the entire class attribute
for each object which has one, whereas function
data.class returns only
the first element of this vector.
storage.mode.
object.size.
dataset.date for a
precise definition and caveats. Only objects in directory databases will
have nonzero
dataset.date values. The dates are always returned as
integers (
date.format=1) in a summary, though they are typically
displayed in a different format by the print method.
# 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