Hi
See if this function works for you (I didn't properly test it...):

nlist=function(...) {
    a=list(...);
    names(a)=as.character(match.call()[2:(length(a)+1)])
    return(a);
}

Ex:

> a=1:3
> b=matrix(1:10,nc=2)
> nlist(a,b)
$a
[1] 1 2 3

$b
     [,1] [,2]
[1,]    1    6
[2,]    2    7
[3,]    3    8
[4,]    4    9
[5,]    5   10

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to