[R] using edit.data.frame

Anne York york at noaa.gov
Wed Dec 4 23:26:03 CET 2002


THanks very much.  str() gives me the info that two of the columns are
actually time-series. So, applying as.numeric to the offending columns 
allows the editor to work.

Anne

> summary(dum)
      yrcl           sland             s02              s234       
 Min.   :50.00   Min.   :0.7820   Min.   :0.1780   Min.   :0.6350  
 1st Qu.:57.25   1st Qu.:0.8390   1st Qu.:0.3260   1st Qu.:0.8033  
 Median :64.50   Median :0.9000   Median :0.3835   Median :0.8480  
 Mean   :64.50   Mean   :0.8853   Mean   :0.3767   Mean   :0.8390  
 3rd Qu.:71.75   3rd Qu.:0.9255   3rd Qu.:0.4208   3rd Qu.:0.8758  
 Max.   :79.00   Max.   :0.9740   Max.   :0.4930   Max.   :0.9220  
> 
> str(dum)
`data.frame':   30 obs. of  4 variables:
 $ yrcl : num  50 51 52 53 54 55 56 57 58 59 ...
 $ sland: Time-Series  from 1950 to 1979: 0.882 0.842 0.907 0.824 0.786 ...
 $ s02  : Time-Series  from 1950 to 1979: 0.413 0.421 0.457 0.383 0.297
0.326 0.178 0.366 0.493 0.433 ...
 $ s234 : num  0.850 0.873 0.922 0.804 0.742 ...
> 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Anne E. York
National Marine Mammal Laboratory
Seattle WA 98115-0070  USA
e-mail: anne.york at noaa.gov
Voice: +1 206-526-4039
Fax: +1 206-526-6615
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

On 4 Dec 2002, Peter Dalgaard BSA wrote:

|Anne York <york at noaa.gov> writes:
|
|> dum is a simple data frame transferred to Splus using the dump() 
|> command in Splus and the source() in R. All fields are numeric. There
|> are no missing data. The data frame looks like it is should:
|> 
|> > apply(dum,2,mode)
|>      yrcl     sland       s02      s234 
|> "numeric" "numeric" "numeric" "numeric" 
|> > apply(dum,2,is.vector)
|>  yrcl sland   s02  s234 
|>  TRUE  TRUE  TRUE  TRUE 
|> > is.data.frame(dum)
|> [1] TRUE
|> 
|> But, when I try to use the edit.data.frame command, 
|> 
|> > edit.data.frame(dum)
|> Error in edit.data.frame(dum) : Can only handle vector and factor elements
|> > 
|> 
|> Any ideas why this won't work?
|
|Not really, but what do you get from
|
|str(dum)
|summary(dum)
|lapply(dum, mode) # suspect that apply(dum, 2, mode) isn't quite the same
|lapply(dum, class)
|
|?
|-- 
|   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
|




More information about the R-help mailing list