[R] object not found inside function

2007-06-01 Thread Maria Montez
Hi! When running the following code I get the message: Error in eval(expr, envir, enclos) : object A not found fm - function(p,ydata, env = parent.frame()) { #fit model y ~ (b0+b1x1+...+bpxp)*exp(g2plus*z2plus) where bi and g2plus are parameters #create design matrix for linear part fo00

[R] combinations of m objects into r groups

2006-12-12 Thread Maria Montez
Hi! Suppose I have m objects. I need to find out what are all possible ways I can group those m objects into r groups. Moreover, I need to create a matrix that contains what those arrangements are. I've created code for when r=2 but I've come to a halt when trying to generalize it into r

Re: [R] generating an expression for a formula automatically

2006-08-28 Thread Maria Montez
Aug 2006, Maria Montez wrote: Thank you for your answers yesterday. I now have another question! Suppose that instead of creating a formula for a regression model I simply wanted to add the variables. I believe I cannot use the as.formula anymore. Again I tried to use expression to no avail

Re: [R] generating an expression for a formula automatically

2006-08-25 Thread Maria Montez
use it. fit.sum - function(x) { fo - expression(paste(x, collapse = +)) eval( fo) } fit.sum(c(x1,x2)) Basically what I need is to learn how to use variables when what is given to me are their names (character list). Thanks again, Maria Sundar Dorai-Raj wrote: Maria Montez wrote

[R] generating an expression for a formula automatically

2006-08-24 Thread Maria Montez
Hi! I would like to be able to create formulas automatically. For example, I want to be able to create a function that takes on two values: resp and x, and then creates the proper formula to regress resp on x. My code: fit.main - function(resp,x) { form - expression(paste(resp, ~

[R] how to add point and label to boxplot using bwplot

2006-06-01 Thread Maria Montez
Hi. My data contains information for 10 hospitals for 12 different measures. Let's call it x1-x12. I need to create a boxplot for each one of this measures and put them into one page. Each plot also needs to be independent, i.e. cannot use the group feature because of different scales for each