Skip to content
Prev 58750 / 398502 Next

list -> environment coercion

Hi Valery,

a simple way to do it might be the following:

lis <- list(a=10, b=20, d="x")
e1 <- new.env()
for(i in 1:length(lis)) assign(names(lis)[i], lis[[i]], envir=e1)
####
d
get("d", env=e1)


I hope it helps.

Best,
Dimitris

----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/396887
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat/
     http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm


----- Original Message ----- 
From: "Valery A.Khamenya" <vak at biovision-discovery.de>
To: <r-help at stat.math.ethz.ch>
Sent: Tuesday, November 09, 2004 4:56 PM
Subject: [R] list -> environment coercion