To further explain my case.. am reproducing one of the examples.from one of contributors' guides.. _______________ attach(ais) here<- sex=="f" plot(pcBfat[here]~ht[here], xlab = Height, ylab = % Body fat) panel.smooth(ht[here],pcBfat[here]) detach(ais) ______________ A condition is in "here",... I am not able to use a similar conditioning as an argument to a function..
Any suggestions will be highly appreciated! Thnx.. Santosh On Fri, Nov 20, 2009 at 5:40 PM, Santosh <santosh2...@gmail.com> wrote: > Dear Rxperts! > > I was wondering if it is possible to write a function which can take in > argument of a subset or condition.. Of course, I am aware of the alternate > methods like coplot, par.plot, xyplot etc... I am specifically interested in > using conditions/subsets with "plot".. > > A simple fragmented example is shown here.. > > pltit <- function(y,x,dat,dat1,dat2,sbst) { > plot(y~x, data=dat, subset=sbst) > lines(y~x,data=dat1, subset=subst) > points(y~x,data=dat2,subset=subst) > } > > pltit(profit,weeks,dat=zone1, sbst='group==1&sales>200') > > Could you also suggest pointers/references/examples on efficient ways to > plot simulated data overlaid with observed data? > > Have a good weekend! > > Thanx, > Santosh > > [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.