The R Project SVN R

Rev

Rev 80766 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 80766 Rev 80921
Line 22... Line 22...
22
       USE.NAMES = TRUE)
22
       USE.NAMES = TRUE)
23
.mapply(FUN, dots, MoreArgs)
23
.mapply(FUN, dots, MoreArgs)
24
}
24
}
25
\arguments{
25
\arguments{
26
  \item{FUN}{function to apply, found via \code{\link{match.fun}}.}
26
  \item{FUN}{function to apply, found via \code{\link{match.fun}}.}
27
  \item{\dots}{arguments to vectorize over (vectors or lists of strictly
27
  \item{\dots}{arguments to vectorize over, will be recycled to common
28
    positive length, or all of zero length).  See also \sQuote{Details}.}
28
  length (zero if one of them is).  See also \sQuote{Details}.}
29
  \item{dots}{\code{\link{list}} or \code{\link{pairlist}} of arguments to
29
  \item{dots}{\code{\link{list}} or \code{\link{pairlist}} of arguments to
30
    vectorize over, see \code{\dots} above.}
30
    vectorize over, see \code{\dots} above.}
31
  \item{MoreArgs}{a list of other arguments to \code{FUN}.}
31
  \item{MoreArgs}{a list of other arguments to \code{FUN}.}
32
  \item{SIMPLIFY}{logical or character string; attempt to reduce the
32
  \item{SIMPLIFY}{logical or character string; attempt to reduce the
33
    result to a vector, matrix or higher dimensional array; see
33
    result to a vector, matrix or higher dimensional array; see
Line 35... Line 35...
35
  \item{USE.NAMES}{logical; use the names of the first \dots argument, or
35
  \item{USE.NAMES}{logical; use the names of the first \dots argument, or
36
    if that is an unnamed character vector, use that vector as the names.}
36
    if that is an unnamed character vector, use that vector as the names.}
37
}
37
}
38
\details{
38
\details{
39
  \code{mapply} calls \code{FUN} for the values of \code{\dots}
39
  \code{mapply} calls \code{FUN} for the values of \code{\dots}
40
  (re-cycled to the length of the longest, unless any have length zero),
40
  (re-cycled to the length of the longest, unless any have length zero
-
 
41
  where recycling to zero length will return \code{list()}),
41
  followed by the arguments given in \code{MoreArgs}.  The arguments in
42
  followed by the arguments given in \code{MoreArgs}.  The arguments in
42
  the call will be named if \code{\dots} or \code{MoreArgs} are named.
43
  the call will be named if \code{\dots} or \code{MoreArgs} are named.
43
 
44
 
44
  For the arguments in \code{\dots} (or components in \code{dots}) class specific
45
  For the arguments in \code{\dots} (or components in \code{dots}) class specific
45
  subsetting (such as \code{\link{[}}) and \code{length} methods will be
46
  subsetting (such as \code{\link{[}}) and \code{length} methods will be
Line 66... Line 67...
66
       c(A = 10, B = 0, C = -10))
67
       c(A = 10, B = 0, C = -10))
67
 
68
 
68
word <- function(C, k) paste(rep.int(C, k), collapse = "")
69
word <- function(C, k) paste(rep.int(C, k), collapse = "")
69
## names from the first, too:
70
## names from the first, too:
70
utils::str(L <- mapply(word, LETTERS[1:6], 6:1, SIMPLIFY = FALSE))
71
utils::str(L <- mapply(word, LETTERS[1:6], 6:1, SIMPLIFY = FALSE))
-
 
72
 
-
 
73
mapply(word, "A", integer()) # gave Error, now list()
71
}
74
}
72
\keyword{manip}
75
\keyword{manip}
73
\keyword{utilities}
76
\keyword{utilities}