Re: [R] Replacing values in matrix/dataframe according to changing criteria

2011-11-21 Thread Frederik Lyngsaa Lang
Dear Michael, First, thanks a lot for your suggestion. It seems to work very well. However, trying to implement it into my code I realize the rest of my code is simply running too slowly due to a lot of loops. The problem lies in the step where I read in a text file showing the different communit

Re: [R] Replacing values in matrix/dataframe according to changing criteria

2011-11-16 Thread R. Michael Weylandt
This is a little ugly, but I think it should work pretty robustly: T <- table(unlist(df[,-1])) # Take a close look at this to see how it works -- it's the key to the whole thing and basically creates something we will roughly use like a hash-table (if that term is familiar to you) (or more accurat