[R] help on data.frames/data.entry

Sean Davis sdavis2 at mail.nih.gov
Tue Mar 23 12:50:27 CET 2004


Francesca,

See ?colnames and ?rownames.  Also, I highly suggest looking at some of the
documentation at www.r-project.org.  There are many, many pages of
well-documented examples of working with data frames and other R data
structures that you may find useful.

Sean
----- Original Message -----
From: "Francesca Buffa" <buffa at gci.ac.uk>
To: <r-help at stat.math.ethz.ch>
Sent: Tuesday, March 23, 2004 6:30 AM
Subject: [R] help on data.frames/data.entry


> Dear R-help,
>
>
>
> I have a matrix D of dimensions 200 x 26; rows are my cases and columns
are
> my variables. I would like to create a data.frame "DF" with row.names=
> myrownames (this is a vector of characters of length 200) and column names
> "mycolnames" (a vector of characters of length 26). I could find the
option
> in data.frame for naming rows, but not for naming columns. So I did:
>
> > data.entry(D, Names= mycolnames)
>
> > DF <- data.frame(D,row.names=myrownames)
>
> but after the first command (i.e. > data.entry(D, Names= mycolnames)) I've
> received the warning:
>
> Warning message:
>
> the condition has length > 1 and only the first element will be used in:
if
> (dim(x) == dim(args[[i]])) rn <- dimnames(args[[i]])[[1]] else rn <- NULL
>
> what does this warning mean? Is it affecting the values in my data.frame
> table? Or something else? Is there a better way of defining columns names
in
> a data.frame in automated way?
>
>
>
> Thank you very much
>
> Francesca
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list