I am trying to have a summarize of frequency of values 1 of data frame. but only count of values if column have 1
df = data.frame (A1=c(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0),
A2 = c(1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0),
A3 =c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
A4 =c(1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1))
out may be like count of values if > 0
column count
A1 3
A2 5
A4 4