
David B. answered 04/11/22
Math and Statistics need not be scary
Putting together pieces and guessing we have one dataframe containing the experimental data called Results_Data, with at least 4 variables (DNA_Damage, cell_line, agent, concentration) If one wants to get DNA_Damage means for all combinations of cell_line, agent, and concentration then there is a missing variable in the group_by() function call.
Results_Data - source data frame
Summarized_Data - data frame with means ( This is correctly referenced in the code as Results_Data is sent to group_by, then on to summarize, and finally to Summarized_Data)
This would be 3 errors.
#1 - if concentration is a factor, it should be included in the group_by() function call if one wants all combinations.
#2 - Line 3 is missing a right bracket ')' at the end of the line
#3 - calculate-mean is an undefined function. mean() should be used.