The R Project SVN R

Rev

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

Rev 68948 Rev 69769
Line 1... Line 1...
1
% File src/library/base/man/Vectorize.Rd
1
% File src/library/base/man/Vectorize.Rd
2
% Part of the R package, https://www.R-project.org
2
% Part of the R package, https://www.R-project.org
3
% Copyright 1995-2011 R Core Team
3
% Copyright 1995-2015 R Core Team
4
% Copyright 2002-2010 The R Foundation
4
% Copyright 2002-2010 The R Foundation
5
% Distributed under GPL 2 or later
5
% Distributed under GPL 2 or later
6
 
6
 
7
\name{Vectorize}
7
\name{Vectorize}
8
\alias{Vectorize}
8
\alias{Vectorize}
Line 32... Line 32...
32
  \code{\link{mapply}}.  Only those that are actually passed will be
32
  \code{\link{mapply}}.  Only those that are actually passed will be
33
  vectorized; default values will not.  See the examples.
33
  vectorized; default values will not.  See the examples.
34
 
34
 
35
  \code{Vectorize} cannot be used with primitive functions as they do
35
  \code{Vectorize} cannot be used with primitive functions as they do
36
  not have a value for \code{\link{formals}}.
36
  not have a value for \code{\link{formals}}.
-
 
37
  
-
 
38
  It also cannot be used with functions that have arguments named
-
 
39
  \code{FUN}, \code{vectorize.args}, \code{SIMPLIFY} or
-
 
40
  \code{USE.NAMES}, as they will interfere with the \code{Vectorize}
-
 
41
  arguments.  See the \code{combn} example below for a workaround.  
37
}
42
}
38
\value{
43
\value{
39
  A function with the same arguments as \code{FUN}, wrapping a call to
44
  A function with the same arguments as \code{FUN}, wrapping a call to
40
  \code{\link{mapply}}.
45
  \code{\link{mapply}}.
41
}
46
}
Line 66... Line 71...
66
 
71
 
67
Vm <- seq(140, 310, length.out = 50)
72
Vm <- seq(140, 310, length.out = 50)
68
K <- seq(0, 0.15, length.out = 40)
73
K <- seq(0, 0.15, length.out = 40)
69
SSvals <- outer(Vm, K, vSS, Treated$rate, Treated$conc)
74
SSvals <- outer(Vm, K, vSS, Treated$rate, Treated$conc)
70
contour(Vm, K, SSvals, levels = (1:10)^2, xlab = "Vm", ylab = "K")
75
contour(Vm, K, SSvals, levels = (1:10)^2, xlab = "Vm", ylab = "K")
-
 
76
 
-
 
77
# combn() has an argument named FUN
-
 
78
combnV <- Vectorize(function(x, m, FUNV = NULL) combn(x, m, FUN = FUNV),
-
 
79
                    vectorize.args = c("x", "m"))
-
 
80
combnV(4, 1:4)
-
 
81
combnV(4, 1:4, sum)
71
}
82
}
72
\keyword{manip}
83
\keyword{manip}
73
\keyword{utilities}
84
\keyword{utilities}