On 09/05/2011 11:57 AM, Ron Michael wrote:
Dear all, I would really appreciate if somebody can help me to understand what does the
phrase "Vectorize your function" mean? And what is the job of Vectorize()
function in doing that? I have read many threads where experts suggest to Vectorize the
f
On 09/05/2011 1:31 PM, David Winsemius wrote:
On May 9, 2011, at 11:57 AM, Ron Michael wrote:
> Dear all, I would really appreciate if somebody can help me to
> understand what does the phrase "Vectorize your function" mean? And
> what is the job of Vectorize() function in doing that? I have
On May 9, 2011, at 11:57 AM, Ron Michael wrote:
Dear all, I would really appreciate if somebody can help me to
understand what does the phrase "Vectorize your function" mean? And
what is the job of Vectorize() function in doing that? I have read
many threads where experts suggest to Vector
Hi Amol,
It depends on your exact needs, but one way, assuming you do not need
to access previous calculations, only previous elements:
x <- 1:10
x[-10] / x[-1]
The idea is first create a vector, x, then using negative indices,
select the first 9 elements of x (i.e., 1:9) to be divded by the las
?ifelse
Bert Gunter
Genentech Nonclinical Biostatistics
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Steve Jaffe
Sent: Tuesday, July 07, 2009 12:42 PM
To: r-help@r-project.org
Subject: [R] vectorizing a function
I'm sure I'm mi
For this case it is quite simple, see ?ifelse
> z <- ifelse( x > 0, y, -y )
Hope this helps,
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun.
Nevermind, indeed it is obvious: Vectorize !
Steve Jaffe wrote:
>
> I'm sure I'm missing something obvious but I'm not seeing how to simply
> "vectorize" a function of two or more variables.
>
--
View this message in context:
http://www.nabble.com/vectorizing-a-function-tp24380064p24380136
7 matches
Mail list logo