Displaying 2 results from an estimated 2 matches for "flana".
Did you mean:
flang
2010 Mar 12
1
Exporting animation of a series of plots
...ll,
Thank you in advance for your help.
I made an agent-based model in R and I plot it using image() each
timestep creating a nice animation. I can't seem to find in any of the
R codes a means to export the series of images so that they can be
played as a movie or animation.
Thank you again.
Flana
2010 Feb 17
1
lapply to apply a function using a vector
Hi,
First, thank you all for your help.
Here is my problem (simplified):
Say I have a list:
a=list(matrix(50,nrow=5,ncol=5),matrix(25,nrow=5,ncol=5),matrix(10,nrow=5,ncol=5))
I'd like to use rbinom with a different probability for each matrix. I
tried:
b=c(.8,.1,.9)
brep=rep(b,each=25)
lapply(a,function(a) rbinom(25,a,brep))
but that doesn't work-- it just uses the first value of b