Re: [R] Frequency of Combinations

2017-04-25 Thread Thierry Onkelinx
e the (). > > Many thanks > Regards > > > > Sent from my Samsung device > > > Original message > From: Thierry Onkelinx > Date: 24/04/2017 3:43 p.m. (GMT+00:00) > To: abo dalash > Cc: "r-help@R-project.org" > Subject: Re

Re: [R] Frequency of Combinations

2017-04-24 Thread Boris Steipe
This can be easily done in base R. The solution below is pedestrian, transparent and explicit. Thus it's easy to debug and validate(!) each step. Prepare: (1) Save your Excel spreadsheet as a text file with tab-separated values. (2) Initialize a 128 * 128 matrix to hold your results. It should ha

Re: [R] Frequency of Combinations

2017-04-24 Thread Thierry Onkelinx
Dear Mustafa, I'd recommend the packages readxls to import the data, tidyr to transform the data into long format and dplyr to select the data. 1. read the data into R with read_excel() 2. transform sheet 1 into a long format with gather(). The result is one row for each patient / drug combinatio