Re: [R] Coin Toss Simulation

2010-10-13 Thread Shiv
Erik- thank you very much. The rbinom worked. Thanks ! GR From: Erik Iverson-3 [via R] Sent: Wed, October 13, 2010 2:24:18 PM Subject: Re: Coin Toss Simulation Shiv wrote: > I am trying a simple toin coss simulation, of say 200 coin tosses. The idea

Re: [R] Coin Toss Simulation

2010-10-13 Thread Erik Iverson
Shiv wrote: I am trying a simple toin coss simulation, of say 200 coin tosses. The idea is to have a data frame like so: Experiment#Number_Of_Heads 1 104 296 3101 So I do: d <-data.frame(exp_num=c(1,2,3)); /* J

Re: [R] Coin Toss Simulation

2010-10-13 Thread Dimitris Rizopoulos
try this: n <- 3 data.frame(Exp = seq_len(n), Heads = rbinom(n, 200, 0.5)) I hope it helps. Best, Dimitris On 10/13/2010 7:28 PM, Shiv wrote: I am trying a simple toin coss simulation, of say 200 coin tosses. The idea is to have a data frame like so: Experiment#Number_Of_Heads

[R] Coin Toss Simulation

2010-10-13 Thread Shiv
I am trying a simple toin coss simulation, of say 200 coin tosses. The idea is to have a data frame like so: Experiment#Number_Of_Heads 1 104 296 3101 So I do: d <-data.frame(exp_num=c(1,2,3)); /* Just 3 experimen