I have a data frame like this:
Date Impacting_APP Impacted_APP
1/1/2012 PS PayRoll
1/2/2012 PS Web
1/3/2012 PS HR
1/10/2012 Trading PS
2/1/2012 Trading PS
3/1/2012 Trading PS
5/1/2012 PS Payroll
8/1/2012 PS Payroll
8/1/2012 PS Payroll
etc
I need to summarize this data frame like below:
Impacted_APP Impacting_APP Count
PayRoll PS 4
PS Trading 3
can somebody start me with this? Any ideas I can how I can summarize this data set?
The
as.data.frame.tablefunction will take table-data objects and recast them into long format.Note: the failure to match your answer was due to two variants of the factor level “Payroll” and “payroll”. Changing the input data and the order of arguments to
tableproduces:After assigning to ‘counts.df’ this code would adress the desire in the comment for selective display of the results: