[R] Data manipulation - multiplicate cases

MarcioRibeiro mestat at pop.com.br
Thu Mar 26 21:26:43 CET 2009


Hi listers,
I am trying to arrange my data and I didn't find any information how to do
it!
I have a data with 3 variables: X Y Z
1-I would like to multiplicate de information of X according to the number I
have for my Y variable...
2-Then I want to identify with a dicotomic variable by the number according
my variable Z from X...
I can do the first part by...
z<-rep(x,y)
But I don't know how to set a dicotomic variable according to Z...
Exemple...
I have...
X      Y    Z
123   3    1
234   3    1
345   4    2
456   3    2
I want to get...
X      Y    Z
123   3    1
123   3    0
123   3    0
234   3    1
234   3    0
234   3    0
345   4    1
345   4    1
345   4    0
345   4    0
456   3    1
456   3    1
456   3    0

Thanks in advance...
-- 
View this message in context: http://www.nabble.com/Data-manipulation---multiplicate-cases-tp22730453p22730453.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list