Leon Yee wrote: > But the problem is that I have MANY vectors, whose names are of some > specific pattern. It is not good for us to write a very long expression. > > vectors <- list(ls(pattern="xyz")) didn't get what I want.
then you could mix the two approaches: vectors = lapply(ls(pattern="xyz"), get) u = NULL for (v in vectors) ... which version is better will of course depend on the particular context of your problem. vQ ______________________________________________ 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.