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
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
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
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
4 matches
Mail list logo