I have a data frame containing many columns, including Quarter and CustomerID . In this, I want to highlight the unique combination of Quarter and CustomerID .
For instance,
masterdf <- read.csv(text = " Quarter, CustomerID, ProductID 2009 Q1, 1234, 1 2009 Q1, 1234, 2 2009 Q2, 1324, 3 2009 Q3, 1234, 4 2009 Q3, 1234, 5 2009 Q3, 8764, 6 2009 Q4, 5432, 7")
I want to:
FilterQuarter UniqueCustomerID 2009 Q1 1234 2009 Q2 1324 2009 Q3 8764 2009 Q3 1234 2009 Q4 5432
How to do it in R? I tried the unique function, but it does not work the way I want.
source share