Hi,
I have this simple df:
source <- data.frame(
stringsAsFactors = FALSE,
Employee.ID = c("aaa",
"bbb","sss","ccc","fff","ffg","gedd"),
Age.Group = c("20-30",
"30-40","20-30","40-50","40-50","20-30",
"20-30"),
Action_Positivity = c(100, 0, 100, 0, 0, 100, 100),
Boundaries_Positivity = c(0, 0, 100, 100, 100, 0, 100),
Growth = c(3, 4, 2, 4, 5, 5, 5),
Career.Wellbeing_Positivity = c(100, 0, 0, 0, 0, 100, 100),
eSat_Positivity = c(0, 0, 100, 100, 100, 100, 100),
Technolory = c(2, 5, 3, 4, 4, 1, 5)
)
Now I need a table with Average eSat_Positivity for all other variables ending with "Positivity".
I know I can do it one by one:
impact.on.scores <- source %>%
group_by(Action_Positivity) %>%
summarize(mean_Sat = mean(eSat_Positivity))
impact.on.scores
But what I really need is either eSat_Positivity mean scores for all other "Positivity" variables on the left like:
- Action_Positivity 100
- Action_Positivity 0
- Boundaries_Positivity 100
- Boundaries_Positivity 0
- Career.Wellbeing_Positivity 100
- Career.Wellbeing_Positivity 0
...or, if easier, two separate tables:
- eSat_Positivity mean scores for all "Positivity" variables scored 100:
- Action_Positivity
- Boundaries_Positivity
- Career.Wellbeing_Positivity
- eSat_Positivity mean scores for all "Positivity" variables scored 0:
- Action_Positivity
- Boundaries_Positivity
- Career.Wellbeing_Positivity
Is this possible at all?