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

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -