'sum of elements in a list column in r
I have a dataset with a column of lists of numbers. I want to mutate a column that has the sum of elements of each row's list. I tried this:
data %>% mutate(duration_sum = sum(unlist(Durations)))
But the duration_sum column values are all NA. Why is that and how can I fix this?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
