[R] integrating 2 lists and a data frame in R

Bert Gunter bgunter.4567 at gmail.com
Tue Jun 6 03:57:36 CEST 2017


Reproducible example, please. -- In particular, what exactly does C look ilike?

(You should know this by now).

-- Bert
Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Mon, Jun 5, 2017 at 6:45 PM, Bogdan Tanasa <tanasa at gmail.com> wrote:
>  Dear all,
>
> please could you advise on the R code I could use in order to do the
> following operation :
>
> a. -- 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
>
> 2 -- and a data frame 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 data frame C, in order
> to obtain a DATA FRAME,
>
> -- 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 frame C.
>
> A little example would be :
>
>       n1  n2  n3 n4
>
>       m1  100  -   -   -
>
>       m2  300  -   -   -
>
>       m3   -   -   -   -
>
>       m4   -   -   -   -
>
>       m5   -   -   -   -
> I wrote a script in perl, although i would like to do this in R
> Many thanks ;)
> -- bogdan
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list