Hi there,
I have an Excel table here
when I try to do it in R - it would give me a result, but it's not what I want
stringsAsFactors = FALSE,
Status = c("a", "b", "c", "d", "e"),
count = c(1L, 1L, 1L, 1L, 1L),
Status.1 = c("b", "b", "b", "e", NA),
Status.2 = c("c", "c", "e", NA, NA)
)
Test %>%
group_by(Status.1 ) %>%
mutate( totals = sum(count))
Here I don't want the Totals for a to appear as 3, it should be 0 because "a" appears in Status.1 zero times.
any help would be appreciated.