[R] how use the subset?

Steve Lianoglou mailinglist.honeypot at gmail.com
Fri Jul 31 06:22:59 CEST 2009


Hi,

On Jul 31, 2009, at 12:02 AM, Jie TANG wrote:

> hi ,everyone
>
> I  want subtract some dataset by subset.
>
>> From the help running  help(subset),  ths information is  
>> "*subset(airquality,
> Day == 1, select = -Temp)* "
>
>
>
> while  I running my script written as "*g1data<-subset(errdata,  
> fac>12) *"
> ,it is wrong with the error information "*subset.default(newerrdata,
> fac>12),can not find fac*"
>
>
> and g1 in read from the file as shown below
> *errdata<-scan("err.dat",what = list(mon=0,day=0,err=0,fac=0))*
>
> While I changed to *g1data<-subset(errdata, errdata$fac>12)*, there  
> is no
> error message any more  but it seems that *g1data* dooes be selected.
>
> who can help me to subset the dataset?

As per the posting guide, please post a small/simple example of a  
data.frame you are trying to subset and show us the queries you are  
using and what you expect to get out of it.

We'll show you where you're going wrong ;-)

-steve

--
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




More information about the R-help mailing list