Hi, On Fri, Sep 14, 2012 at 2:33 PM, agrins <agri...@d.umn.edu> wrote: > HI all- > > I have used this .fun in S+ without a problem however, in R when I run this > code to generate multiple graphs: > > trendplot<-function(datafr,dataf2, abbrev="", titlestr="", > devname="s",filen="",styr=1990,endyr=2012) { > if (!is.null(dev.list())) {dev.off()} > > dataf<-datafr[datafr$abbrev==abbrev,] #subset entire > dataset with one > species at a time > dataf2sp<-dataf2[dataf2$abbrev==abbrev,] etc... > > It returns "Error in dataf2$abbrev : $ operator is invalid for atomic > vectors" > > Is there an easy fix for this error?
I suspect you just have to ensure that the thing you are passing in to the `dataf2` parameter is in fact a data.frame -- the error you are getting suggests that it is currently not. Also -- have no fear for the space bar, it is your friend ;-) -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Sloan-Kettering Cancer Center | Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact ______________________________________________ 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.