I'm expanding on a previous conversation (Reference to other post). I'm having trouble figuring out how to grab a mean for a group of specific ID numbers across different units of time within my data. For example, if I wanted to take CD-01 through CD-09 & CD-11 across V2 to V6 and plot that mean, then take V7 through V10 and plot that then V11 and V12 and the same thing. Then do that again for CD-103 and 105 and the SS etc. I suppose I still have to keep the data frame in long but I'm struggling with the data management part like selecting the columns.
So basically a mean plot that across at different points in the data set. Any information would be helpful. Thank you
heartrate <- tibble::tribble(
~V1, ~V2, ~V3, ~V4, ~V5, ~V6, ~V7, ~V8, ~V9, ~V10, ~V11, ~V12,
"ID Number", 0L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L,
"CD-01", 66L, 66L, 64L, 64L, 58L, 58L, 58L, 57L, 56L, 56L, 57L,
"SS-02", 85L, 84L, 83L, 81L, 80L, 79L, 78L, 78L, 79L, 80L, 80L,
"CD-03", 103L, 103L, 103L, 103L, 103L, 103L, 103L, 103L, 103L, 103L, 103L,
"CD-04", 115L, 115L, 114L, 114L, 114L, 114L, 112L, 111L, 110L, 109L, 109L,
"SS-101", 63L, 63L, 63L, 63L, 77L, 78L, 80L, 77L, 76L, 67L, 67L,
"CD-05", 84L, 63L, 62L, 62L, 63L, 58L, 58L, 54L, 62L, 66L, 66L,
"SS-102", 49L, 48L, 46L, 46L, 45L, 46L, 45L, 45L, 45L, 45L, 46L,
"CD-103", 70L, 69L, 68L, 68L, 69L, 69L, 69L, 69L, 68L, 69L, 70L,
"CD-06", 83L, 84L, 84L, 84L, 84L, 84L, 82L, 82L, 82L, 82L, 81L,
"SS-08", 79L, 78L, 67L, 67L, 68L, 62L, 62L, 62L, 63L, 72L, 72L,
"CD-09", 240L, 202L, 141L, 106L, 89L, 74L, 71L, 71L, 71L, 72L, 74L,
"SS-10", 78L, 78L, 77L, 76L, 75L, 75L, 75L, 75L, 76L, 76L, 76L,
"CD-105", 66L, 66L, 66L, 66L, 66L, 66L, 67L, 67L, 67L, 67L, 68L,
"CD-11", 66L, 66L, 76L, 76L, 76L, 77L, 75L, 75L, 75L, 75L, 76L
)
head(heartrate)