I am really new to R and am hoping to find the average rate of error for each individual id I have in my data set. I have created the data set error_rates that includes the columns "sorter_id_error" and "sorter_error".
My code:
##Determine the average error_rate per volunteer id
error_data<- data.frame(sorter_id_error,sorter_error)
library(tidyverse)
library(dplyr)
error_data %>%
group_by(sorter_id_error) %>% summarise(average=mean(sorter_error))
My error:
I keep getting warnings returned and my data ends up with a bunch of NAs instead of the averages.
sorter_id_error average
1 6 NA
2 7 NA
3 17 NA
4 25 NA
5 33 NA
6 34 NA
7 41 NA
8 45 NA
9 46 NA
10 47 NA
... with 118 more rows
There were 50 or more warnings (use warnings() to see the first 50)
What I would like:
I would like to average the the sorter_error
variable, so that for each averages all the values of the sorter_id_error
variable by levels.
What am I doing wrong/ how can I fix my code in order to get these values?
Thanks!