I have a dataset with 2 columns: user and seconds. User is a categorical variable, with each user being assigned a number. A user can appear multiple times in the dataset. Seconds represent the amount of time spent on a page.
I have already used factor()
so that R recognizes the user variable as categorical. However, I can't figure out how to find the minimum number of seconds for each user. that is, I can find the overall minimum number of seconds, but I can't find User 1's minimum or User 2's minimum. Any suggestions on how to proceed?
Data
user seconds
1 35
1 30
1 25
1 20
2 15
1 15
2 10
1 10
2 5
1 5