Re: [R] a quick question about "rbinom"

2012-01-05 Thread David Winsemius
On Jan 5, 2012, at 12:56 AM, Bert Gunter wrote: David! ... It means the author either doesn't know the 'sample' function, or wants you to understand how to use 'rbinom', or that's just the way she thinks. Could someone help? Thanks so much, X1<-c("A","B")[rbinom(n,1,0.6)+1] X2<-c("C","

Re: [R] a quick question about "rbinom"

2012-01-04 Thread Bert Gunter
David! ... > > It means the author either doesn't know the 'sample' function, or wants you > to understand how to use 'rbinom', or that's just the way she thinks. > >>> Could someone help? Thanks so much, >>> X1<-c("A","B")[rbinom(n,1,0.6)+1] X2<-c("C","D")[rbinom(n,1,0.1)+1] > > > C.f. >

Re: [R] a quick question about "rbinom"

2012-01-04 Thread David Winsemius
On Jan 4, 2012, at 8:46 PM, David Winsemius wrote: On Jan 4, 2012, at 7:43 PM, Robert Baer wrote: -Original Message- From: lynn.tsai Sent: Wednesday, January 04, 2012 3:38 PM To: r-help@r-project.org Subject: [R] a quick question about "rbinom" Hello, I have the foll

Re: [R] a quick question about "rbinom"

2012-01-04 Thread lynn.tsai
Hi, thank you all for replying. First, it's not a homework. I'm learning R and the CFA (configural frequency analysis). I am trying to understand this part of the code so that I can modify it and run a simulation for power analysis of CFA. Thanks again. -- View this message in context: http://

Re: [R] a quick question about "rbinom"

2012-01-04 Thread David Winsemius
On Jan 4, 2012, at 7:43 PM, Robert Baer wrote: -Original Message- From: lynn.tsai Sent: Wednesday, January 04, 2012 3:38 PM To: r-help@r-project.org Subject: [R] a quick question about "rbinom" Hello, I have the following code using rbinom, but I don't understand wha

Re: [R] a quick question about "rbinom"

2012-01-04 Thread Robert Baer
-Original Message- From: lynn.tsai Sent: Wednesday, January 04, 2012 3:38 PM To: r-help@r-project.org Subject: [R] a quick question about "rbinom" Hello, I have the following code using rbinom, but I don't understand what *"+1"* means in the code. Could som

Re: [R] a quick question about "rbinom"

2012-01-04 Thread David Winsemius
On Jan 4, 2012, at 5:31 PM, Justin Haynes wrote: homework or not, ?rbinom should be plenty. I didn't think so. I thought that the answer was: ?"[" -- David. On Wed, Jan 4, 2012 at 1:38 PM, lynn.tsai wrote: Hello, I have the following code using rbinom, but I don't understand

Re: [R] a quick question about "rbinom"

2012-01-04 Thread Steve Lianoglou
A direct answer to your question: On Wed, Jan 4, 2012 at 4:38 PM, lynn.tsai wrote: > Hello, I have the following code using rbinom, but I don't understand what > *"+1"* means in the code. Could someone help? Thanks so much, > >> X1<-c("A","B")[rbinom(n,1,0.6)+1] >> X2<-c("C","D")[rbinom(n,1,0.1)+

Re: [R] a quick question about "rbinom"

2012-01-04 Thread Justin Haynes
homework or not, ?rbinom should be plenty. On Wed, Jan 4, 2012 at 1:38 PM, lynn.tsai wrote: > Hello, I have the following code using rbinom, but I don't understand what > *"+1"* means in the code. Could someone help? Thanks so much, > > > X1<-c("A","B")[rbinom(n,1,0.6)+1] > > X2<-c("C","D")

Re: [R] a quick question about "rbinom"

2012-01-04 Thread Bert Gunter
Homework? If not, context? -- Bert On Wed, Jan 4, 2012 at 1:38 PM, lynn.tsai wrote: > Hello, I have the following code using rbinom, but I don't understand what > *"+1"* means in the code. Could someone help? Thanks so much, > >> X1<-c("A","B")[rbinom(n,1,0.6)+1] >> X2<-c("C","D")[rbinom(n,1,0.

[R] a quick question about "rbinom"

2012-01-04 Thread lynn.tsai
Hello, I have the following code using rbinom, but I don't understand what *"+1"* means in the code. Could someone help? Thanks so much, > X1<-c("A","B")[rbinom(n,1,0.6)+1] > X2<-c("C","D")[rbinom(n,1,0.1)+1] -- View this message in context: http://r.789695.n4.nabble.com/a-quick-question-about-r