Re: [R] How to parse and eval a collection of items

2009-06-18 Thread Gabor Grothendieck
This does not use an apply: unlist(mget(thels, .GlobalEnv)) On Thu, Jun 18, 2009 at 5:25 PM, Carl Witthoft wrote: > Let's say I have, for some reason, a bunch of scalars (i.e. single-valued > variables) and I want to merge them all into a single vector of values.  Can > someone recommend a bette

Re: [R] How to parse and eval a collection of items

2009-06-18 Thread Carl Witthoft
Hi, do.call doesn't help, but the solution provided by Henrique D. is much cleaner than my hack: > sapply(ls(patt='foo'),get) Thanks to all. Carl Rolf Turner wrote: On 19/06/2009, at 9:25 AM, Carl Witthoft wrote: Let's say I have, for some reason, a bunch of scalars (i.e. single-valu

Re: [R] How to parse and eval a collection of items

2009-06-18 Thread Rolf Turner
On 19/06/2009, at 9:25 AM, Carl Witthoft wrote: Let's say I have, for some reason, a bunch of scalars (i.e. single-valued variables) and I want to merge them all into a single vector of values. Can someone recommend a better function, or simpler way, to do so than the following? Suppose my sc

Re: [R] How to parse and eval a collection of items

2009-06-18 Thread Henrique Dallazuanna
You can get the values using get: sapply(ls(patt = "foo"), get) On Thu, Jun 18, 2009 at 6:25 PM, Carl Witthoft wrote: > Let's say I have, for some reason, a bunch of scalars (i.e. single-valued > variables) and I want to merge them all into a single vector of values. Can > someone recommend a

[R] How to parse and eval a collection of items

2009-06-18 Thread Carl Witthoft
Let's say I have, for some reason, a bunch of scalars (i.e. single-valued variables) and I want to merge them all into a single vector of values. Can someone recommend a better function, or simpler way, to do so than the following? Suppose my scalars' names are foo1, foo2, foo3, foo1high, foo