[R] How to build a matrix of number of appearance?

UriB uriblass at gmail.com
Mon Jul 4 11:48:33 CEST 2011


I have a matrix of claims at year1 that I get simply by 

claims<-read.csv(file="Claims.csv")
qq1<-claims[claims$Year=="Y1",]

I have MemberID and ProviderID for every claim in qq1 both are integers

An example for the type of questions that I want to answer is 
how many times ProviderID number 345 appears together with MemberID 23 in
the table qq1

In order to answer these questions for every possible ProviderId and every
possible MemberID 
I would like to have a matrix that has first column as memberID when every
memberID in qq1 appears only once and columns that have number of appearance
of ProviderID==i for every i that has
sum(qq1$ProviderID==i)>0

My question is if there is a simple way to do it in R
Thanks in Advance 

Uri

--
View this message in context: http://r.789695.n4.nabble.com/How-to-build-a-matrix-of-number-of-appearance-tp3643248p3643248.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list