How do I count the number of times where A happened and B happened with R from a table? -


let's data

a b c 0 1 0 1 1 0   <- here , b 1 1 0 0 0 1 1 1 1 1   <- here 1 1 0   <- , here 

i want count number of times both , b 1. in case 3. easy sql have no idea how r.

if df data.frame columns, a,b,c:

sum(df$a==1 & df$b==1) 

Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

php - Boolean search on database with 5 million rows, very slow -

css - Text drops down with smaller window -