I starting to data-mine a mobile application, and I have a database that looks like this:
Database UserId Hour Date 01 18 01.01.2016 01 18 01.01.2016 01 14 02.01.2016 01 14 03.01.2016 02 21 03.01.2016 02 08 05.01.2016 02 08 05.01.2016 03 23 05.01.2016
I would like to add a new column to this database that sums the number of different days the user has been using the application, In this database for example UserId#01 has been on the platform in three different days,
Expected data outcomes like this:
Database UserId Hour Date NumDates 01 18 01.01.2016 3 01 18 01.01.2016 3 01 14 02.01.2016 3 01 14 03.01.2016 3 02 21 03.01.2016 2 02 08 05.01.2016 2 02 08 05.01.2016 2 03 23 05.01.2016 1
So far I have used this command:
Database["NumDates"] % group_by(UserId) %>% summarise(NumDates = length(unique(Date)))
But it tells me that that it is creating only 5000 lines (the number of different users in my database) when I need +600,000 (the number of sessions in my database)
If somebody could help me with this, it will be greatly appreciated!