The R Project SVN R

Rev

Rev 59039 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 59039 Rev 59340
Line 1... Line 1...
1
% File src/library/stats/man/setNames.Rd
1
% File src/library/stats/man/setNames.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-2007 R Core Team
3
% Copyright 1995-2012 R Core Team
-
 
4
% Copyright 2005-2012 The R Foundation
4
% Distributed under GPL 2 or later
5
% Distributed under GPL 2 or later
5
 
6
 
6
\name{setNames}
7
\name{setNames}
7
\alias{setNames}
8
\alias{setNames}
8
\title{Set the Names in an Object}
9
\title{Set the Names in an Object}
9
\usage{
10
\usage{
10
setNames(object, nm)
11
setNames(object = nm, nm)
11
}
12
}
12
\arguments{
13
\arguments{
13
 \item{object}{an object for which a \code{names} attribute will be meaningful }
14
 \item{object}{an object for which a \code{names} attribute will be meaningful }
14
 \item{nm}{a character vector of names to assign to the object}
15
 \item{nm}{a character vector of names to assign to the object}
15
}
16
}
Line 29... Line 30...
29
setNames( 1:3, c("foo", "bar", "baz") )
30
setNames( 1:3, c("foo", "bar", "baz") )
30
# this is just a short form of
31
# this is just a short form of
31
tmp <- 1:3
32
tmp <- 1:3
32
names(tmp) <-  c("foo", "bar", "baz")
33
names(tmp) <-  c("foo", "bar", "baz")
33
tmp
34
tmp
-
 
35
 
-
 
36
## special case of character vector, using default
-
 
37
setNames(nm = c("First", "2nd"))
34
}
38
}
35
\keyword{list}
39
\keyword{list}