[R] Transforming matrix to data.frame: problems

Agustin Lobo alobo at ija.csic.es
Fri Nov 9 20:46:57 CET 2001


Hi all,

I have problems transforming a matrix 
into a data.frame:

If I do:

> is.matrix(parcelas.cobtot.conti)
[1] TRUE
> dim(parcelas.cobtot.conti)
[1] 25 64

> a  <- data.frame(parcelas.cobtot.conti)
> is.data.frame(a)
[1] TRUE
> 
> dim(a)
[1] 1600    3

Why a does not have the same dimensions than 
parcelas.cobtot.conti?

I've tested with caith and the behaviour there
is different:

> data(caith)
> is.data.frame(caith)
[1] TRUE
> dim(caith)
[1] 4 5

> a <- as.matrix(caith)
> dim(a)
[1] 4 5
> b <- data.frame(a)
> dim(b)
[1] 4 5

What can be wrong with parcelas.cobtot.conti ?
I'd appreciate any help

Thanks,

Agus

Dr. Agustin Lobo
Instituto de Ciencias de la Tierra (CSIC)
Lluis Sole Sabaris s/n
08028 Barcelona SPAIN
tel 34 93409 5410
fax 34 93411 0012
alobo at ija.csic.es



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