I use R
and run the following comands
x = c(1,2,3)
y = c(4,5,6)
s = rbinom(1,1,0.5)
ifelse(s==1,x,y)
However, when I run it instead of getting the whole vectors on each case, I just get back the first element of the vector. How do I solve that?
I use R
and run the following comands
x = c(1,2,3)
y = c(4,5,6)
s = rbinom(1,1,0.5)
ifelse(s==1,x,y)
However, when I run it instead of getting the whole vectors on each case, I just get back the first element of the vector. How do I solve that?