| Line 1... |
Line 1... |
| 1 |
% File src/library/base/man/ls.Rd
|
1 |
% File src/library/base/man/ls.Rd
|
| 2 |
% Part of the R package, http://www.R-project.org
|
2 |
% Part of the R package, http://www.R-project.org
|
| 3 |
% Copyright 1995-2010 R Core Team
|
3 |
% Copyright 1995-2012 R Core Team
|
| 4 |
% Distributed under GPL 2 or later
|
4 |
% Distributed under GPL 2 or later
|
| 5 |
|
5 |
|
| 6 |
\name{ls}
|
6 |
\name{ls}
|
| 7 |
\alias{ls}
|
7 |
\alias{ls}
|
| 8 |
\alias{objects}
|
8 |
\alias{objects}
|
| 9 |
\title{List Objects}
|
9 |
\title{List Objects}
|
| 10 |
\usage{
|
10 |
\usage{
|
| 11 |
ls(name, pos = -1, envir = as.environment(pos),
|
11 |
ls(name, pos = -1L, envir = as.environment(pos),
|
| 12 |
all.names = FALSE, pattern)
|
12 |
all.names = FALSE, pattern)
|
| 13 |
objects(name, pos= -1, envir = as.environment(pos),
|
13 |
objects(name, pos= -1L, envir = as.environment(pos),
|
| 14 |
all.names = FALSE, pattern)
|
14 |
all.names = FALSE, pattern)
|
| 15 |
}
|
15 |
}
|
| 16 |
\arguments{
|
16 |
\arguments{
|
| 17 |
\item{name}{which environment to use in listing the available objects.
|
17 |
\item{name}{which environment to use in listing the available objects.
|
| 18 |
Defaults to the \emph{current}
|
18 |
Defaults to the \emph{current} environment. Although called
|
| 19 |
environment. Although called \code{name} for back compatibility, in
|
19 |
\code{name} for back compatibility, in fact this argument can
|
| 20 |
fact this argument can specify the environment in any form; see the
|
20 |
specify the environment in any form; see the \sQuote{Details} section.}
|
| 21 |
details section.}
|
- |
|
| 22 |
\item{pos}{an alternative argument to \code{name} for specifying the
|
21 |
\item{pos}{an alternative argument to \code{name} for specifying the
|
| 23 |
environment as a position in the search list. Mostly there for
|
22 |
environment as a position in the search list. Mostly there for
|
| 24 |
back compatibility.}
|
23 |
back compatibility.}
|
| 25 |
\item{envir}{an alternative argument to \code{name} for specifying the
|
24 |
\item{envir}{an alternative argument to \code{name} for specifying the
|
| 26 |
environment. Mostly there for back compatibility.}
|
25 |
environment. Mostly there for back compatibility.}
|
| Line 30... |
Line 29... |
| 30 |
\item{pattern}{an optional \link{regular expression}. Only names
|
29 |
\item{pattern}{an optional \link{regular expression}. Only names
|
| 31 |
matching \code{pattern} are returned. \code{\link{glob2rx}} can be
|
30 |
matching \code{pattern} are returned. \code{\link{glob2rx}} can be
|
| 32 |
used to convert wildcard patterns to regular expressions.}
|
31 |
used to convert wildcard patterns to regular expressions.}
|
| 33 |
}
|
32 |
}
|
| 34 |
\description{
|
33 |
\description{
|
| 35 |
\code{ls} and \code{objects} return a vector of character strings
|
34 |
\code{ls} and \code{objects} return a vector of character strings
|
| 36 |
giving the names of the objects in the specified environment.
|
35 |
giving the names of the objects in the specified environment. When
|
| 37 |
When invoked with no argument at the top level prompt,
|
36 |
invoked with no argument at the top level prompt, \code{ls} shows what
|
| 38 |
\code{ls} shows what data sets and functions a user has defined.
|
37 |
data sets and functions a user has defined. When invoked with no
|
| 39 |
When invoked with no argument inside a function,
|
38 |
argument inside a function, \code{ls} returns the names of the
|
| 40 |
\code{ls} returns the names of the functions local variables.
|
39 |
function's local variables: this is useful in conjunction with
|
| 41 |
This is useful in conjunction with \code{browser}.
|
40 |
\code{browser}.
|
| 42 |
}
|
41 |
}
|
| 43 |
\details{
|
42 |
\details{
|
| 44 |
The \code{name} argument can specify the environment from which
|
43 |
The \code{name} argument can specify the environment from which
|
| 45 |
object names are taken in one of several forms:
|
44 |
object names are taken in one of several forms:
|
| 46 |
as an integer (the position in the \code{\link{search}} list); as
|
45 |
as an integer (the position in the \code{\link{search}} list); as
|