у меня есть ключ в таблице A, а в таблице B у меня есть ключ и номер.Как я могу достичь формулы Excel Sumifs (числовой, tableB.key, tableA.key, tableA.key, 1) с dplyr без объединения двух таблиц
я уже пробовал summarise_if в mutate
mutate(newColumn = summarise_if(tableB, .predicate = tableB$Key == .$Key, .funs = sum(tableB$numeric)))
but i get this error
In tableB$Key == .$Key:
longer object length is not a multiple of shorter object length
tableA tableB
key key numeric
1 1 10
2 1 30
3
4
Expected
key newColumn
1 40
2
3
4