[R] Managing list elements

From: Luis Felipe Parra <felipe.parra_at_quantil.com.co>
Date: Fri, 11 Jun 2010 12:23:21 -0500


Hello, I have two lists with the same number of elements

> tail(LHS)
[[1]]
[1] "antecedentes.factor_riesgo=17" "antecedentes.estado=1"
"antecedentes.medio=4" "tarjetas_flagrancia.adquiriente2="
[[2]]
[1] "antecedentes.riesgo=1" "antecedentes.estado=1"
"antecedentes.medio=4" "tarjetas_flagrancia.adquiriente2="
[[3]]
[1] "resultado_investig.pto_comp=N" "antecedentes.riesgo=1"
"antecedentes.factor_riesgo=17" "antecedentes.medio=4"
[[4]]
[1] "resultado_investig.pto_comp=N" "antecedentes.riesgo=1"
"antecedentes.factor_riesgo=17" "tarjetas_flagrancia.adquiriente2="
[[5]]
[1] "resultado_investig.pto_comp=N" "antecedentes.factor_riesgo=17"
"antecedentes.medio=4" "tarjetas_flagrancia.adquiriente2="
[[6]]
[1] "resultado_investig.pto_comp=N" "antecedentes.riesgo=1"
"antecedentes.medio=4" "tarjetas_flagrancia.adquiriente2=" > tail(RHS)
[[1]]
[1] "antecedentes.riesgo=1"
[[2]]
[1] "antecedentes.factor_riesgo=17"
[[3]]
[1] "tarjetas_flagrancia.adquiriente2="
[[4]]
[1] "antecedentes.medio=4"
[[5]]
[1] "antecedentes.riesgo=1"
[[6]]
[1] "antecedentes.factor_riesgo=17"

>

I would like to create a new list from this two which would have in every list entry one entry with the corresponding elements from LHS and another entry with the corresponding element from RHS (LHS doesn't always have three 4 elements per entry). Do you know how can I do this? Thank you

Felipe Parra

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
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. Received on Fri 11 Jun 2010 - 17:28:00 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 11 Jun 2010 - 18:40:28 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive