: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of stephen sefick
Sent: Wednesday, 16 April 2008 10:40 AM
To: Rolf Turner
Cc: r-help@r-project.org
Subject: Re: [R] Transposing Data Frame does not return numeric entries
ok
site1 site2 site3 site4
species1 1 2 3
ok
site1 site2 site3 site4
species1 1 2 3 4
species2 30 4 5
species3 5 3 73
spesies4 0 3 67
species1 species2 species3 species4
site1 1
RML: *** Data frames are NOT matrices!!! ***
On 16/04/2008, at 10:35 AM, stephen sefick wrote:
> x <- read.table("LittleGarvin.csv", sep=",", header=TRUE)
> y <- t(x)
> str(y)
>
> chr [1:193, 1:288] "oligocha" "0" " 0" " 0" " 0" "0" ...
> - attr(*, "dimnames")=List of 2
> ..$ : chr [1:193]
I have a species as rows and sites as columns matrix. I would like to
tranpose this matrix so that I can do an NMDS analysis with the vegan
package. I have used
y <- t(x)
and it indeed transposes the matrix, but it changes the whole make up
chr [1:193, 1:288] "oligocha" "0" " 0" " 0" " 0" "0"
x <- read.table("LittleGarvin.csv", sep=",", header=TRUE)
y <- t(x)
str(y)
chr [1:193, 1:288] "oligocha" "0" " 0" " 0" " 0" "0" ...
- attr(*, "dimnames")=List of 2
..$ : chr [1:193] "X" "upwd1201" "upwd0502" "upwd0702" ...
..$ : NULL
x is a data frame with a whole bunch of numeric vectors I
5 matches
Mail list logo