Dear List,I am trying to use rep function in the following conditions A = c( 5, 6, 7, 11, 9, 12, 10, 15) B = c(12,15, 21, 31, 25, 27,32, *34*,13,12, 34, 33, 24, 29, 26, *28*,22,14,27,22,21,12,32, 16) I need to repeat each element of A, as many times as each element of B, for the entire length of B. for example, repeat 5, for 12 times, 6 for 15 times,........, 15 for 34 times, and then, again, 5 for 13 times, 6 for 12 times,........, 15 for 28 times, and so on. I used, the function rep(A, times = B) It didn't work because apparently, the times command , worked for only if the length of A and B was equal. Thank you for your help in advance. -- Subodh Acharya University of Florida Gainesville, FL. [[alternative HTML version deleted]]
Dear List,I am trying to use rep function in the following conditions A = c( 5, 6, 7, 11, 9, 12, 10, 15) B = c(12,15, 21, 31, 25, 27,32, *34*,13,12, 34, 33, 24, 29, 26, *28*,22,14,27,22,21,12,32, 16) I need to repeat each element of A, as many times as each element of B, for the entire length of B. for example, repeat 5, for 12 times, 6 for 15 times,........, 15 for 34 times, and then, again, 5 for 13 times, 6 for 12 times,........, 15 for 28 times, and so on. I used, the function rep(A, times = B) It didn't work because apparently, the times command , worked for only if the length of A and B was equal. Thank you for your help in advance. -- Subodh Acharya University of Florida Gainesville, FL. [[alternative HTML version deleted]]