Displaying 4 results from an estimated 4 matches for "f3c".
Did you mean:
f32
2013 Feb 02
3
vectorisation
Hi
I'm trying to set up a simulation problem without resorting to (m)any loops. I want to set entries in a data frame of zeros ('starts' in the code below) to 1 at certain points and the points have been randomly generated and stored in a separate data.frame ('sl'), which has the same number of columns.
An example of the procedure is as follows:
ml <-
2010 Jul 15
1
Error using the mi package
...2c* c12d* c12e* c12f* c19* d1* d2* d3*
d6* d7a* d7b* d7c* d7d* d7e* d7f* d7g* d7h* d7i* d8a* d8b*
d8c* d8d* d8e* d8f* d8g* d8h* d8i* d9a* d9b* d9c* d9d*
d9e* d10a* d10b* d10c* d10d* d10e* d10f* d11* d13* d14* e1*
e2* e3* e5* e6* f2* f3a* f3b* f3c* f3d* f3e* f4* f6* f7*
f8* f9* f12* f14* f15* f16* f20* f21* f22* f23* f25* g2*
g3* g6* g8* g9* g12* g13* g15* g17* g18* g22* g25* g26*
g27* g28* g31* g34* g43* g55* g58* g59* g60* g61* g63*
g65* g68a* g68b* g69* g70* g71* g91* g92* g93* g94...
2005 Apr 27
1
RE: [R] when can we expect Prof Tierney's compiled R?
...) for (i in iA) 1
> f4 <- function(x, iA) for (i in iA) x[i] = 1.0
> f5 <- function(x, iA) for (i in iA) i-1
> f6 <- function(x, iA) for (i in iA) i
>
> Make byte compiled versions:
>
> f1c <- cmpfun(f1)
> f2c <- cmpfun(f2)
> f3c <- cmpfun(f3)
> f4c <- cmpfun(f4)
> f5c <- cmpfun(f5)
> f6c <- cmpfun(f6)
>
> and run them:
>
> > system.time(f1(x, iA))
> [1] 5.43 0.04 5.56 0.00 0.00
> > system.time(f1c(x, iA))
> [1] 1.77 0.03 1.81 0.00 0.00
>...
2005 Apr 22
1
RE: [R] when can we expect Prof Tierney's compiled R?
If we are on the subject of byte compilation, let me bring a couple of
examples which have been puzzling me for some time. I'd like to know a)
if the compilation will likely to improve the performance for this type
of computations, and b) at least roughly understand the reasons for the
observed numbers, specifically why x[i]<- assignment is so much slower
than x[i] extraction.
The loops