vendredi 2 février 2018

if condition in r to get the favorite game

I have the below data with me.

CONTACT_WID                                                        X_GAME_NM TITLE_NOMIN_DT
1    87768026 Disney Beauty and the Beast: The Enchanted Rose (Explorer eBook)     2013-01-08
2    87768026                            Disney Pixar Tangled eBook (Explorer)     2013-01-04
3    87768026                        kuttiSchool: Hamster Music! kuttilet (US)     2013-01-06
4    87768049                                     Dora the Explorer (Explorer)     2012-12-27
5    87768049                                       Onboard Pet App (kuttiPad)     2012-12-27
6    87768357                                       Onboard Pet App (kuttiPad)     2012-12-30
  TotalPerGame TotalPerCust Percentage_game
1       28.954      534.252        5.419540
2      147.367      534.252       27.583799
3      357.931      534.252       66.996661
4      757.279      839.759       90.178134
5       82.480      839.759        9.821866
6       28.765       28.765      100.000000

How do i write a if condition or any condition in R so that i get a column with my favourite game as the one which has Percentage_game >50% ?

Aucun commentaire:

Enregistrer un commentaire