Hello everybody. I've been experimenting with mapply(). Does anyone else have problems with: R> mapply(rep,times=1:4, MoreArgs=42) (I get a seg fault). robin R> R.version _ platform powerpc-apple-darwin6.6 arch powerpc os darwin6.6 system powerpc, darwin6.6 status beta major 1 minor 8.0 year 2003 month 10 day 02 language R>
On Tue, 14 Oct 2003, Robin Hankin wrote:> Hello everybody. > > I've been experimenting with mapply(). Does anyone else have problems with: > > R> mapply(rep,times=1:4, MoreArgs=42) > > (I get a seg fault). >Yes, thanks for reporting this. You should get an error message instead: the correct syntax would be mapply(rep, times=1:4, MoreArgs=list(42)) It looks as though just coercing to a list would probably be sufficient. -thomas
I get this too on the released version. I guess the problem is that the value passed to MoreArgs is not a list. Maybe, mapply(rep, times = 1:4, MoreArgs = list(42)) produces what you want? At any rate, R shouldn't segfault so it looks like bug somewhere. -roger Robin Hankin wrote:> Hello everybody. > > I've been experimenting with mapply(). Does anyone else have problems > with: > > R> mapply(rep,times=1:4, MoreArgs=42) > > (I get a seg fault). > > robin > > > > R> R.version > _ > platform powerpc-apple-darwin6.6 > arch powerpc > os darwin6.6 > system powerpc, darwin6.6 > status beta > major 1 > minor 8.0 > year 2003 > month 10 > day 02 > language R > >> > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help >
Robin Hankin <rksh at soc.soton.ac.uk> writes:> Hello everybody. > > I've been experimenting with mapply(). Does anyone else have problems with: > > R> mapply(rep,times=1:4, MoreArgs=42) > > (I get a seg fault).So do I. It's a bug, but I suppose list(42) is what you need. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907