[R] dataframe behavior

Martin Henry H. Stevens hstevens at rci.rutgers.edu
Fri May 4 15:36:10 CEST 2001


Thanks for the prompting. I used unclass(belle) and found all kinds of wacky
attributes including rownames associated different variables. Although
class(belle) returned 'data.frame' is was sufficiently screwed up to behave
in an unusual manner.
My rather inelegant solution was:

 bm <- data.frame(matrix(as.numeric(as.matrix(belle)),nrow=48))
names(bdf) <- names(belle)

Henry

----- Original Message -----
From: "Peter Dalgaard BSA" <p.dalgaard at biostat.ku.dk>
To: "Martin Henry H. Stevens" <hstevens at rci.rutgers.edu>
Cc: <r-help at stat.math.ethz.ch>
Sent: Thursday, May 03, 2001 5:50 PM
Subject: Re: [R] dataframe behavior


> "Martin Henry H. Stevens" <hstevens at rci.rutgers.edu> writes:
>
> > Windows98, Emacs20.7, ESS5.1.18
> >
> > I recently constructing a data.frame "belle" that now does not spew its
> > contents when I type the name on the command line (see errors below). It
> > will only do so if I specify columns. Incidently, plot(belle) displays
the
> > pairs plot of all variables.
> >
> > > belle
> > Error in as.data.frame.default(x[[i]], optional = TRUE) :
> >  can't coerce array into a data.frame
> > > belle[,]
> > Error in [.data.frame(belle, , ) : Argument "j" is missing, with no
default
> > > class(belle)
> > [1] "data.frame"
> > > belle[,1:3]
> >    block plot trt
> > 1      2   25   9
> > 2      2   26  16
> > 3      2   27   6
> > ..........
> >
> > Any idea what is going on?
> > thanks
>
> No, but you might get an idea by typing dput(belle) or unclass(belle)
> or print.default(belle)
>
> --
>    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
>

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