Let's create example data (since you didn't provide a reprex):
library(tidyverse)
df <- c("ID", "Time", "AngryHRFHbO,1,1", "AngryHRFHbR,1,1", "HappyHRFHbO,4,1", "HappyHRFHbT,2,2") %>%
map_dfc(~ runif(5)) %>%
set_names(c("ID", "Time", "AngryHRFHbO,1,1", "AngryHRFHbR,1,1", "HappyHRFHbO,4,1", "HappyHRFHbT,2,2"))
Now to process these variable names, we need to have them as data in a column, so we need to pivot to the long format. We want to pivot all column names except "ID" and "Time".
df %>%
pivot_longer(-c(ID, Time), names_to = "variable_name")
You could also select column names that starts_with() "Angry" and "Happy", there are a number of selection helpers available.
Then you can use separate to split on a separator, or extract to use a regular expression.
df %>%
pivot_longer(-c(ID, Time), names_to = "variable_name") %>%
extract(variable_name, into=c("condition", "chromophore", "source"), regex = "^([A-Z][a-z]+HRF)(Hb[ROT]),([0-9],[0-9])$")