Dear all, I have 4 sites and want to determine how different they are from each other. For this I have decided to use R though it seems a bit daunting to learn. I have read data in from a CSV the structure is : Species1 Species2 Species3 Site1 4 4 7 Site2 3 1 0 Site3 0 99 6 Site4 75 3 33 There are many more species than shown above this is just an example. Here are the questions. How do I read one row of data so as to load site2 into a variable called site2? Once I plot a graph using ordiplot how do I extract it from R so that I can put it into a Word for Windows document? Once I have the data in varables I hope to use designdist and Sørensen to discover diversity indices. I had a crack at this once but because I had sites as the columns it didn't work. Now that I think I have the data correct I can proceed. x Input data (this will be the whole data set that I read into my variable 'allSites' from a CSV.)? The variables for Sørensen will contain terms J for shared quantity, A and B for totals, N for the number of rows (sites) and P for the number of columns (species) and 'Binary' as the term. How do I get the shared number of species for each row? Probably very beginner type questions but I want to get on an haven't yet found the answers in my trawl throgh the help. Is there a book that I can buy to learn R? All the best, Richard Price MSc student University Birmingham. [[alternative HTML version deleted]]
Hi. You should study "An Introduction to R" manual. It is installed with R in PDF format and is accessible from the menu (Help -> Manuals (in PDF) -> ) There are several links in the R web site. Go to http://www.r-project.org/ and see links under the word "Documentation" in the left frame. There are some contributed documents: http://cran.r-project.org/other-docs.html Array manipulations are described in the chapter 5 of the Introduction. The plot window has its own menu allowing using of the Windows clipboard (you didn't describe your system, but "Word for Windows" suggests you're on Windows). Richard Price-4 wrote:> > Dear all, > > I have 4 sites and want to determine how different they are from each > other. For this I have decided to use R though it seems a bit daunting to > learn. > I have read data in from a CSV the structure is : > > Species1 Species2 Species3 > > Site1 4 4 7 > Site2 3 1 0 > Site3 0 99 6 > Site4 75 3 33 > > There are many more species than shown above this is just an example. Here > are the questions. > > How do I read one row of data so as to load site2 into a variable called > site2? > > Once I plot a graph using ordiplot how do I extract it from R so that I > can put it into a Word for Windows document? > > Once I have the data in varables I hope to use designdist and S?rensen > to discover diversity indices. I had a crack at this once but because I > had sites as the columns it didn't work. Now that I think I have the data > correct I can proceed. > > x Input data (this will be the whole data set that I read into my > variable 'allSites' from a CSV.)? > > The variables for S?rensen will contain terms J for shared quantity, A and > B for totals, N for the number of rows (sites) and P for the number of > columns (species) and 'Binary' as the term. > > How do I get the shared number of species for each row? > > Probably very beginner type questions but I want to get on an haven't > yet found the answers in my trawl throgh the help. Is there a book that I > can buy to learn R? > > All the best, > Richard Price > MSc student University Birmingham. > >-- View this message in context: http://www.nabble.com/Very-new---beginners-questions-tf4260866.html#a12125845 Sent from the R help mailing list archive at Nabble.com.
Hi r-help-bounces at stat.math.ethz.ch napsal dne 13.08.2007 14:04:50:> Dear all, > > > I have 4 sites and want to determine how different they are from eachother.> For this I have decided to use R though it seems a bit daunting tolearn.> I have read data in from a CSV the structure is : > > Species1 Species2 Species3 > > Site1 4 4 7 > Site2 3 1 0 > Site3 0 99 6 > Site4 75 3 33 > > There are many more species than shown above this is just an example.Here are> the questions. > > How do I read one row of data so as to load site2 into a variablecalled site2? ?read.table and other read..... commands. Do not work with variables but with data frames.> > Once I plot a graph using ordiplot how do I extract it from R so that Ican> put it into a Word for Windows document?1. save a graph from menu 2. use ?png, ?jpeg and others to see how to output graph to files (devices)> > Once I have the data in varables I hope to use designdist and S?rensento> discover diversity indices. I had a crack at this once but because I hadsites> as the columns it didn't work. Now that I think I have the data correctI can proceed.> > x Input data (this will be the whole data set that I read into myvariable> 'allSites' from a CSV.)? > > The variables for S?rensen will contain terms J for shared quantity, Aand B> for totals, N for the number of rows (sites) and P for the number ofcolumns> (species) and 'Binary' as the term. > > How do I get the shared number of species for each row? > > Probably very beginner type questions but I want to get on an haven'tyet> found the answers in my trawl throgh the help. Is there a book that Ican buy> to learn R?look at CRAN. You can find various books from beginners to quite advanced. e.g. P.Dalgaard Introductory statistics with R isd quite good for first steps. Or you can consult Rtips from Paul Johnson. (Just type statsrus into Google). Good idea is also to look into posting guide. Regards Petr> > All the best, > Richard Price > MSc student University Birmingham. > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.
Hi Richard, No specific answers for your data questions but for learning R there are any number of resources. There are links to references for books and a large number of on-line materials on the R website. Have a look at the list on the bottom left of the screen for "books" and "other" which leads to "contributed documentation". Books by Dalgaard, Verzani and Crawley all get good reviews. In the contributed documents area "Using R for Data Analysis and Graphics - Introduction, Examples and Commentary? by John Maindonald and "Kickstarting R" by Jim Lemon are both very useful. I have also found that while An Introduction to R is invaluable it is best to download it and keep it as a pdf or a hard copy. Also it is better as a 'second intro' after you have looked at some of the books or other supporting documentation. Don't forget to browse the FAQs. They answer some of the more vexing questions about R very well. (Oh if you want to move a graph from R to Word in Windows just right click on the graph and copy it.) --- Richard Price <freerichard at btinternet.com> wrote:> Dear all, > > > I have 4 sites and want to determine how different > they are from each other. For this I have decided to > use R though it seems a bit daunting to learn. > I have read data in from a CSV the structure is : > > Species1 Species2 Species3 > > Site1 4 4 7 > Site2 3 1 0 > Site3 0 99 6 > Site4 75 3 33 > > There are many more species than shown above this is > just an example. Here are the questions. > > How do I read one row of data so as to load site2 > into a variable called site2? > > Once I plot a graph using ordiplot how do I extract > it from R so that I can put it into a Word for > Windows document? > > Once I have the data in varables I hope to use > designdist and S?rensen to discover diversity > indices. I had a crack at this once but because I > had sites as the columns it didn't work. Now that I > think I have the data correct I can proceed. > > x Input data (this will be the whole data set that > I read into my variable 'allSites' from a CSV.)? > > The variables for S?rensen will contain terms J for > shared quantity, A and B for totals, N for the > number of rows (sites) and P for the number of > columns (species) and 'Binary' as the term. > > How do I get the shared number of species for each > row? > > Probably very beginner type questions but I want > to get on an haven't yet found the answers in my > trawl throgh the help. Is there a book that I can > buy to learn R? > > All the best, > Richard Price > MSc student University Birmingham. > > > > [[alternative HTML version deleted]] > > > ______________________________________________ > R-help at stat.math.ethz.ch 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. >
Apparently Analagous Threads
- data.frame transformation
- Function for translation of a list into a matrix as used by ordination?
- reading long matrix
- I cannot get species scores to plot with site scores in MDS when I use a distance matrix as input. Problems with NA's?
- Joining Dataframes