[R] How to optimizing the code for calculating the launch time

2014-08-05 Thread Lingyi Ma
My dataset: Item_IdYear_Month B65623262 201204 B58279745 201204 B33671102 201204 B36630946 201204 B63270151 201204 B63270133 201204 I have written my code to calculate one more column which is the product maturity time as the following: launchtime<-functi

[R] How to avoid the three loops in R?

2014-08-01 Thread Lingyi Ma
I have the following data set: Country Product Price Year_Month AE 1 20201204 DE 1 20201204 CN 1 28201204 AE 2 28201204 DE 2 28201204 CN 2