I have a tibble I am working with with NAs in a column. I want to replace the NAs (numeric column) with the mean of the column and queue_name column. For example, the NA for row two will be replaced by the mean where queue is "B". NA should be 150 for all queue B's with NA.
call_center_tbl <- tribble(~queue_name, ~talk_time,
"A", 230,
"B", "NA",
"C", 150,
"A", 200,
"B", 100,
"B", 200,
"C", "NA")
I hope this makes sense. Thank you!