Re: [R] converting character strings to eval

2004-07-20 Thread Deepayan Sarkar
On Tuesday 20 July 2004 06:19, John Hendrickx wrote: > Couldn't eval be modified to automatically parse arguments if they're > not expressions? Something like: > eval2<-function(arg) { > if (!is.expression(arg)) arg<-parse(text=arg) > eval(arg) > } > Would a construction like eval2 hav

Re: [R] converting character strings to eval

2004-07-20 Thread John Hendrickx
--- Deepayan Sarkar <[EMAIL PROTECTED]> wrote: > On Monday 19 July 2004 09:37, Wayne Jones wrote: > > Hi there fellow R-users, > > > > I'm stuck on this seemingly trivial problem. > > > > All I want to coerce a character string into a command. > > > > For example: > > > > x<-rnorm(20) > > y<-rnorm(

[R] converting character strings to eval

2004-07-19 Thread Vito Ricci
Hi, try with the package cluster! Bye Vito Hello, I'm trying to do a cluster analysis on a large data set. I tried it out with a smaller one first, but I got this error: > hc<-hclust(dist(x),"ave") Error: cannot allocate vector of size 4129151 Kb The data sample used (i.e. "x")

RE: [R] converting character strings to eval

2004-07-19 Thread Wayne Jones
Thanks folks, That's exactly what I needed. Thanks for the speedy replies. Regards Wayne -Original Message- From: Dimitris Rizopoulos [mailto:[EMAIL PROTECTED] Sent: 19 July 2004 15:49 To: Wayne Jones Cc: [EMAIL PROTECTED] Subject: Re: [R] converting character strings to eva

Re: [R] converting character strings to eval

2004-07-19 Thread Deepayan Sarkar
On Monday 19 July 2004 09:37, Wayne Jones wrote: > Hi there fellow R-users, > > I'm stuck on this seemingly trivial problem. > > All I want to coerce a character string into a command. > > For example: > > x<-rnorm(20) > y<-rnorm(20) > str<-"lm(y~x)" > > I want to evaluate the "str" command. > > I

Re: [R] converting character strings to eval

2004-07-19 Thread Dimitris Rizopoulos
: http://www.med.kuleuven.ac.be/biostat/ http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm - Original Message - From: "Wayne Jones" <[EMAIL PROTECTED]> To: "R-help" <[EMAIL PROTECTED]> Sent: Monday, July 19, 2004 4:37 PM Subject: [R] converting ch

Re: [R] converting character strings to eval

2004-07-19 Thread Roger D. Peng
eval(parse(text = str)) -roger Wayne Jones wrote: Hi there fellow R-users, I'm stuck on this seemingly trivial problem. All I want to coerce a character string into a command. For example: x<-rnorm(20) y<-rnorm(20) str<-"lm(y~x)" I want to evaluate the "str" command. I have tried eval(as.

[R] converting character strings to eval

2004-07-19 Thread Wayne Jones
Hi there fellow R-users, I'm stuck on this seemingly trivial problem. All I want to coerce a character string into a command. For example: x<-rnorm(20) y<-rnorm(20) str<-"lm(y~x)" I want to evaluate the "str" command. I have tried eval(as.expression(str)) But it doesn't seem to work.