Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- date Rank new_Weight
- 2019-01-01 20 2
- 2019-01-01 30 5
- 2019-01-01 10 8
- 2019-02-02 3 10
- 2019-02-02 5 2
- .... ... ....
- by(df, df$date,subset) fuunction(x){
- x<-df$rank*df$new_weight/sum(df$new_weigth)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement