objip: loop through all attached directories looking for pattern,...

View source: R/objip.R

objipR Documentation

loop through all attached directories looking for pattern, possibly restricting to specified class or mode.

Description

Loop objects() through all attached directories (items in the search() list) looking for a regular expression pattern.

Usage

objip(pattern, where = search(), all.names=FALSE, mode="any", class,
      ls.function=if (mode != "any" || !missing(class)) "ls.str" else "ls")

Arguments

pattern

Character string containing a regular expression that is used to list only a subset of the objects. Only names matching 'pattern' are returned.

where

an object defining a database in the search list.

all.names

In R, a logical that is passed to the ls function. If 'TRUE', all object names are returned. If 'FALSE', names which begin with a '.' are omitted.

mode, class

See ls.str and mode for storage mode of an object. See class for object classes.

ls.function

Either ls or ls.str. If either mode or class is specified then the default is ls.str. If neither is specified then the default is ls.

Value

A list of 0 or more character vectors. Each character vector has the name of one of the items in the search() list. Each character vector contains the names of the objects in the specified environment which match the pattern. If there are no matching names in an environment, then the corresponding character vector is removed from the result.

Author(s)

Richard M. Heiberger <rmh@temple.edu>

See Also

ls,

Examples

objip("qq")
objip("^qq")
objip("qq$")
## Not run: 
## R only
objip("rowSums", all.names=TRUE)

## list all objects in the second and third attached packages
search()
objip()[2:3]

## End(Not run)

HH documentation built on Aug. 9, 2022, 5:08 p.m.

Related to objip in HH...