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
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 function, which will speed up entire calculati
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
Hi,
I'm a newbie when it comes to R, and I'm trying to figure out how to use
vectorization as opposed to for loops. In particular, how can I create a
function that is applied on each element of a row, but can access previous
elements relative to that element?
My problem: I want to calculate some
?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 sur
lto:r-help-boun...@r-
> project.org] On Behalf Of Steve Jaffe
> Sent: Tuesday, July 07, 2009 1:42 PM
> To: r-help@r-project.org
> Subject: [R] vectorizing a function
>
>
> I'm sure I'm missing something obvious but I'm not seeing how to simply
> "vect
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
I'm sure I'm missing something obvious but I'm not seeing how to simply
"vectorize" a function of two or more variables.
Say I have
f <- function(x,y) if (x>0) y else -y
Now I have vectors x and y of equal length and I'd like to apply f
element-wise. I.e. conceptually
z <- f(x,y) where x, y, z
10 matches
Mail list logo