dear all,

i've looked at the r-intro (chapter 10, writing your own functions) and searched the r-help archives but am still stuck at the following.

i have a simple function, something like:

myhist<-function(yvar) {
 y<-subset(myframe,yvar>1 & yvar<=150000,select=yvar)
 attach(y)
 hist(yvar)
}


calling it as follows:

myhist(x1)

gives the following error:

Error in attach(y) : attempt to set an attribute on NULL



what am i doing wrong here?

thanks in advance, edwin

______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to