Re: [R] problems with character objects and calls to list() [solved]

2007-07-24 Thread Neil Shephard
Thanks to Patrick Burns and Mark Lyman for their suggestions in solving my problem. Patrick suggested creating the list directly (the solution I opted for) On 7/23/07, Patrick Burns <[EMAIL PROTECTED]> wrote: > Why not make the list directly: > > list.to.convert <- vector('list', n) > for(x i

Re: [R] problems with character objects and calls to list()

2007-07-23 Thread Mark Lyman
> Really I'd like the call to list() to behave as though the text had > been entered directly so that you get > > > list(1:2, 3:4, 5:6) > [[1]] > [1] 1 2 > > [[2]] > [1] 3 4 > > [[3]] > [1] 5 6 > > eval(parse(text=paste("list(",to.convert,")",sep=""))) [[1]] [1] 1 2 [[2]] [1] 3 4 [[3]] [1

[R] problems with character objects and calls to list()

2007-07-23 Thread Neil Shephard
Hi All, I have a problem trying to get a set of columns recognised as a list and can't work out how to do it despite trawling through the mailing list archives, and docs. A short example... to.convert <- NULL n <- 6 for(x in 1:n){ to.convert <- paste(to.convert, paste((2 * x) -1, (2 * x), sep=