R-beta: Copy/use and Copy/omit on dataframes

Murray Jorgensen maj at waikato.ac.nz
Wed Apr 29 03:38:12 CEST 1998


At 00:47 29/04/98 +0200, Peter Dalgaard BSA wrote:
>Murray Jorgensen <maj at waikato.ac.nz> writes:
>
>> How do you copy from one data frame to another including or omitting rows
>> according to the values in one of the columns.
>> 
>> Past or present Minitab users will know what I am talking about!
>
>Um, not knowing Minitab, I'm not sure that I do... Will subset() do
>what you need?
>
>e.g. new.frame<-subset(old.frame,age>25)
>

Apparently not!  In R 0.49

> summary(zinc)
       MSol              MTot           HFO               pH      
 Min.   :  0.086   Min.   : 200   Min.   : 1.611   Min.   :7.25  
 1st Qu.:  3.404   1st Qu.: 400   1st Qu.: 2.820   1st Qu.:7.50  
 Median : 70.150   Median : 600   Median : 5.640   Median :7.75  
 Mean   :222.200   Mean   : 600   Mean   : 7.252   Mean   :7.75  
 3rd Qu.:361.700   3rd Qu.: 800   3rd Qu.:10.070   3rd Qu.:8.00  
 Max.   :923.400   Max.   :1000   Max.   :16.110   Max.   :8.25  
>  zinc775 _ subset(zinc,pH=7.75)
Error: couldn't find function "subset"
> 

And in S-PLUS 4.0 release 2:

> zinc775 _ subset(zinc,pH=7.75)
Error in .C("S_api_get_message",: couldn't find function "subset"
Dumped
> 

>-- 
>   O__  ---- Peter Dalgaard             Blegdamsvej 3  
>  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
> (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
>~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
>
>
Dr Murray Jorgensen    http://www.cs.waikato.ac.nz/stats/Staff/maj.html
Department of Statistics, University of Waikato, Hamilton,  New Zealand
*Applications Editor, Australian and New Zealand Journal of Statistics*
maj at waikato.ac.nz Phone +64-7 838 4773 home phone 856 6705 Fax 838 4666

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list