Hi everyone,
I'm a beginning R learner and I have a problem where I have reached a point where I cannot figure out how to do the next step.
I have an occurrence matrix made from a set of sample data. The data represents a series of stores, and a series of items held at each store. There are over 6000 unique store locations, and around 400 unique items. The occurrence matrix maps whether the item is at the store. In the sample occurrence matrix the first column is just the auto inputted row identifier, the second is the store ID number, and the first row across is the item list. The matrix is made up of binary 1,0. 1 being a store/item mix that is valid.
What I want to determine from this data is: a way to set a required range of stores and items(ex: show me solutions where there are >50 stores & <3000 stores and item count is <200, but >30) and then have a script loop through and churn out possible universal item mix/store combinations. Only show me lists of unique item & store where all of those items are held in all of those stores and the count for each falls into the range I set. For example in the attached solution, it is a list of items and stores where each item is held at all of those stores. I ideally would want every item/store mix within the range count criteria to be outputted as a separate data frame.
Any ideas how to write a script capable of this?
Link to the sample occurrence matrix csv: http://www44.zippyshare.com/v/sHIgseSS/file.html
Link to a sample solution csv: http://www83.zippyshare.com/v/DUIEHopG/file.html