Reputation: 1
I have a dataframe of 20.000 observations based on 130 participants. There are several observations from each participant.
I'm calculating the participants' response time.
The average is 25.01.
I want to identify the participants that have an average response time >= 10 seconds.
I can't get my head around this. The ideal output would be a matrix/list of names and their corresponding average response time (but only if it's below 10 seconds).
Upvotes: 0
Views: 21
Reputation: 226322
Something like:
library("dplyr")
my_data %>% group_by(subject) %>%
summarise(avg_response=mean(response_time)) %>%
filter(avg_response>=10)
You could also use aggregate()
and subset()
from base R.
Upvotes: 1