I'm filtering my data with too many types to do this line by lines, wondering if it is possible to make a custom function to do it at once, and how do I do it?
I'm trying to make a norm from my data so I need the mean value and standard deviation of them under multiple different condition, there are like 27*6 conditions I may need to consider.
I'm currently using a lot of lines of select() to filter my data with kinds represented in the column names like this
se_fn_F1 <- se_fn %>% select(ParticipantName,contains('F1'))
se_fn_F2 <- se_fn %>% select(ParticipantName,contains('F2'))
se_fn_F3 <- se_fn %>% select(ParticipantName,contains('F3'))
se_fn_F4 <- se_fn %>% select(ParticipantName,contains('F4'))
se_fn_B1 <- se_fn %>% select(ParticipantName,contains('B1'))
se_fn_B2 <- se_fn %>% select(ParticipantName,contains('B2'))
se_fn_B3 <- se_fn %>% select(ParticipantName,contains('B3'))
se_fn_B4 <- se_fn %>% select(ParticipantName,contains('B4'))
se_fn_B5 <- se_fn %>% select(ParticipantName,contains('B5'))
se_fn_B6 <- se_fn %>% select(ParticipantName,contains('B6'))
Obviously this is no a good way to do things like this, but I don't know how can I do it with custom function, need some advises
I realized that there are some information I should've provided. The name of original variables is like this "Single10_F2_FixationTime", which shows the three different category the variable belongs to.