Hi,
Here is an example on how to summarise data if I understand your questions correctly:
library(tidyverse)
#Generate dummy data
set.seed(1)
myData = data.frame(
id = 1:10,
job = paste0("DataScientist", sample(1:3, 10, replace = T)),
value = runif(10)
)
myData
#> id job value
#> 1 1 DataScientist1 0.1765568
#> 2 2 DataScientist3 0.6870228
#> 3 3 DataScientist1 0.3841037
#> 4 4 DataScientist2 0.7698414
#> 5 5 DataScientist1 0.4976992
#> 6 6 DataScientist3 0.7176185
#> 7 7 DataScientist3 0.9919061
#> 8 8 DataScientist2 0.3800352
#> 9 9 DataScientist2 0.7774452
#> 10 10 DataScientist3 0.9347052
#Group by job and perform summary
myData %>% group_by(job) %>% summarise(val = sum(value))
#> # A tibble: 3 x 2
#> job val
#> <chr> <dbl>
#> 1 DataScientist1 1.06
#> 2 DataScientist2 1.93
#> 3 DataScientist3 3.33
Created on 2022-01-19 by the reprex package (v2.0.1)
Hope this helps,
PJ