I want to get the song that user's play most frequently. The three fields I want in the csv file are userId,songId and playCount but the select function is giving an error:
write.csv(group_by(mydata,userId) %.%
summarise(one=max(playCount)) %.%
select(userId,songId,playCount), file="FavouriteSongs.csv")
Error in eval(expr, envir, enclos) : object 'songId' not found
An example of the data looks like this
userId songId playCount
A 568r 85
A 711g 18
C 34n 18
E 454j 65
D 663a 72
B 35d 84
A 34c 72
A 982s 65
E 433f 11
A 565t 7
Thanks in advance