I have a df with the following structure:
$ Name : chr "Blank" "Blank" "Blank" "Blank" ...
$ Time : POSIXct, format: "2017-09-29 00:00:00" "2017-09-29 00:10:02"
"2017-09-29 00:20:03" "2017-09-29 00:30:04" ...
$ meanOD572: num 100935 102148 107541 103944 103911 ..
What I need to do is get every single Name for every single Time, average, and then subtract the mean (OD572) from one of the specific Name values ("Blank") for that specific time point.
I am a bit new to R and I am struggling to solve this. Do any of you have an idea of how to solve this?
Thank you very much. I have tried some ways, but it would be something like:
newDf = df %>%
group_by(Name,Time) %>%
summarize(meanOD572 = mean(OD572, na.rm = TRUE)) %>%
group_by(Name, Time) %>%
meanOD572 <-- meanOD572 - meanOD572(Name == "LB")