dummy value
1 TRUE -2.0
2 FALSE 3.0
3 FALSE 4.0
4 FALSE 2.0
5 TRUE -4.5
6 TRUE 9.0
7 TRUE -1.0
8 FALSE 0.0
9 TRUE 3.0
structure(list(dummy = c(TRUE, FALSE, FALSE, FALSE, TRUE, TRUE,
TRUE, FALSE, TRUE), value = c(-2, 3, 4, 2, -4.5, 9, -1, 0, 3)), class = "data.frame", row.names = c(NA,
-9L))
I would like to count the number of negative (and positive) values of column "value" for observations such that dummy == TRUE.
Any help would be deeply appreciated!