Re: [R] Vegan dataframe not acting nicely

From: Gavin Simpson <gavin.simpson_at_ucl.ac.uk>
Date: Fri, 11 Apr 2008 08:10:55 +0100

On Thu, 2008-04-10 at 20:59 -0400, stephen sefick wrote:
> This is what my data looks like
>
> DOC TOC TKN
> RM119mFeb-06 1 2 3
> RM61mFeb-06 2 4 6
>
> I have this both in a .csv and .txt I have read this in with

Your data can't possibly look like that if you "get" the print out you paste below. I presume you want column that has ended up being labeled as 'X' as the rownames for your read-in object? It looks like R is reading this as a variable, probably because you don't have the delimiters in the header row right? But because you didn't paste the first 2-3 lines of the actual file (as a minimum), we are not able to diagnose the problem for you.

Also, what does this have to do with 'vegan'? This is a basic R import issue.

Feel free to send the file to me off list (or the first few lines of the file) and I'll see why it isn't being read in as you want. I promise to do nothing with the data (other than show you how to read them in to R) and delete them immediately thereafter.

HTH G

>
> read.csv("chemodr.csv", header=T)
>
> and this is what I get
>
> X dAmon DN.N Nitrite.N DOC OP P TKN TOC
> 1 RM215mFeb-06 0.000 0.1300 0.0000 2.5 0.057 0.0420 0.420 2.2
> 2 SCmFeb-06 0.000 0.1200 0.0000 13.0 0.130 0.0960 0.950 12.0
> 3 RM202mFeb-06 0.000 0.1300 0.0000 4.6 0.035 0.0760 0.610 4.3
> 4 RM198mFeb-06 0.000 0.1300 0.0044 5.4 0.032 0.0330 0.910 5.0
> 5 HCmFeb-06 0.000 0.2800 0.0000 3.0 0.016 0.0220 0.800 3.1
> 6 RM190mFeb-06 0.000 0.1600 0.0130 3.3 0.068 0.0480 0.780 3.4
>
> I can not do any ordination analysis because of the X column which is
> the Site column of my data set. How do I get this read in with dAmon
> ... TOC as the "species" and the X column as the "site" column. I am
> sure that I am missing something simple.
> thanks
>
> Stephen
>

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 11 Apr 2008 - 07:21:00 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 11 Apr 2008 - 08:30:30 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive