Please could you advise on the R code I could use in order to do the following operation :
- I have 2 lists of "genome coordinates" : a list is composed by numbers that represent genome coordinates;
let's say list N
:
n1
n2
n3
n4
and a list M
:
m1
m2
m3
m4
m5
- and a dataframe
C
, where for some pairs of coordinates (n,m) from the lists above, we have a numerical intensity;
for example:
n1; m1; 100
n1; m2; 300
The question would be : what is the most efficient R code I could use in order to integrate the list N
, the list M
, and the dataframe C
, in order to obtain a dataframe with:
- list
N
as the columns names - list
M
as the rows names - the values in the cells of
N
*M
, corresponding to the numerical values in the data frameC
.
A little example would be :
n1 n2 n3 n4
m1 100 - - -
m2 300 - - -
m3 - - - -
m4 - - - -
m5 - - - -