[R-sig-eco] Plot NMDS with size of the points related to abundance
Hello list, I am analyzing species composition of weeds in 12 cover crop treatments and a fallow plot. I have been using nmds and got good results and no problems with it (although after some fighting!). My data is a matrix of biomass values sorted by species. Now I'd like to know which of my species are contributing with more biomass to the community in each treatment, that is, I'd like to create a graph such as the one that you get from the option plot (nmds_model, type=t, display=c(species)) but instead of getting just the names of the species, I'd like to see dots of different sizes that would refer to the abundance of each of the species, is that possible at all? I know you can do it with CANOCO but wanted to ask if there is a way to do it in R. I have searched the internet and found something that looks like what I want to do (enclosed to the mail) but haven't found the way to do it. I have already done an Indicator Species Analysis with the multipatt function. That gives me information about the species that are related to some treatments but here I'm just looking for the species with more and less biomass in each treatment. Thank you very much!! Barbara -- Barbara Baraibar Post-doctoral scholar - Weed and Applied Plant Ecology Plant Sciences Department Penn State University University Park, Pennsylvania 16802 web-site:http://www.weedecologypsu.com ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] Plot NMDS with size of the points related to abundance
Dear Roman, Sara and Phil, Thanks so much for your help!! After some playing around with your different options, I got the graph I was looking for (attached). I wasn't using the right words to look for help. Thanks a lot!! Barbara - Original Message - From: Roman Luštrik roman.lust...@gmail.com To: Barbara Baraibar Padro bu...@psu.edu Cc: r-sig-ecology@r-project.org Sent: Tuesday, March 17, 2015 11:42:31 AM Subject: Re: [R-sig-eco] Plot NMDS with size of the points related to abundance After clicking send I remembered that you might want to scale circle sizes according to their area, not radius (which is the default to draw). Then I went to see the link Sarah posted and it deals with this, too (great minds think alike? :) ). Cheers, Roman On Tue, Mar 17, 2015 at 4:39 PM, Roman Luštrik roman.lust...@gmail.com wrote: Assuming you're working with metaMDS from vegan, it's trivial to extract NMDS scores, add some variable and plot the data. The following code would be easy to translate into a generic function. library(vegan) data(dune) sol - metaMDS(dune) # add some variable that will correspond to size of points spc - as.data.frame(cbind(sol$species, mysize = runif(nrow(sol$species pts - as.data.frame(sol$points) library(ggplot2) ggplot(spc, aes(x = MDS1, y = MDS2)) + theme_bw() + geom_point(aes(size = mysize), pch = 1) + geom_point(data = pts, color = red) Cheers, Roman On Tue, Mar 17, 2015 at 4:23 PM, Barbara Baraibar Padro bu...@psu.edu wrote: blockquote Hello list, I am analyzing species composition of weeds in 12 cover crop treatments and a fallow plot. I have been using nmds and got good results and no problems with it (although after some fighting!). My data is a matrix of biomass values sorted by species. Now I'd like to know which of my species are contributing with more biomass to the community in each treatment, that is, I'd like to create a graph such as the one that you get from the option plot (nmds_model, type=t, display=c(species)) but instead of getting just the names of the species, I'd like to see dots of different sizes that would refer to the abundance of each of the species, is that possible at all? I know you can do it with CANOCO but wanted to ask if there is a way to do it in R. I have searched the internet and found something that looks like what I want to do (enclosed to the mail) but haven't found the way to do it. I have already done an Indicator Species Analysis with the multipatt function. That gives me information about the species that are related to some treatments but here I'm just looking for the species with more and less biomass in each treatment. Thank you very much!! Barbara -- Barbara Baraibar Post-doctoral scholar - Weed and Applied Plant Ecology Plant Sciences Department Penn State University University Park, Pennsylvania 16802 web-site: http://www.weedecologypsu.com ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology -- In God we trust, all others bring data. /blockquote -- In God we trust, all others bring data. -- Barbara Baraibar Post-doctoral scholar - Weed and Applied Plant Ecology Plant Sciences Department Penn State University University Park, Pennsylvania 16802 web-site:http://www.weedecologypsu.com ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] Plot NMDS with size of the points related to abundance
Hi Barbara, You don't provide a reproducible example or even tell us what package/function you used to create your NMDS ordination, but you can extract the coordinates, and use them plus your cover values to create a bubble plot in several different ways, including symbols(), the pch argument to base plotting functions, and ggplot(). There's a nice tutorial for one method here: http://flowingdata.com/2010/11/23/how-to-make-bubble-charts/ but searching for bubble plot in R will get you many more options. Sarah On Tue, Mar 17, 2015 at 11:23 AM, Barbara Baraibar Padro bu...@psu.edu wrote: Hello list, I am analyzing species composition of weeds in 12 cover crop treatments and a fallow plot. I have been using nmds and got good results and no problems with it (although after some fighting!). My data is a matrix of biomass values sorted by species. Now I'd like to know which of my species are contributing with more biomass to the community in each treatment, that is, I'd like to create a graph such as the one that you get from the option plot (nmds_model, type=t, display=c(species)) but instead of getting just the names of the species, I'd like to see dots of different sizes that would refer to the abundance of each of the species, is that possible at all? I know you can do it with CANOCO but wanted to ask if there is a way to do it in R. I have searched the internet and found something that looks like what I want to do (enclosed to the mail) but haven't found the way to do it. I have already done an Indicator Species Analysis with the multipatt function. That gives me information about the species that are related to some treatments but here I'm just looking for the species with more and less biomass in each treatment. Thank you very much!! Barbara -- Sarah Goslee http://www.functionaldiversity.org ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] Plot NMDS with size of the points related to abundance
Assuming you're working with metaMDS from vegan, it's trivial to extract NMDS scores, add some variable and plot the data. The following code would be easy to translate into a generic function. library(vegan) data(dune) sol - metaMDS(dune) # add some variable that will correspond to size of points spc - as.data.frame(cbind(sol$species, mysize = runif(nrow(sol$species pts - as.data.frame(sol$points) library(ggplot2) ggplot(spc, aes(x = MDS1, y = MDS2)) + theme_bw() + geom_point(aes(size = mysize), pch = 1) + geom_point(data = pts, color = red) Cheers, Roman On Tue, Mar 17, 2015 at 4:23 PM, Barbara Baraibar Padro bu...@psu.edu wrote: Hello list, I am analyzing species composition of weeds in 12 cover crop treatments and a fallow plot. I have been using nmds and got good results and no problems with it (although after some fighting!). My data is a matrix of biomass values sorted by species. Now I'd like to know which of my species are contributing with more biomass to the community in each treatment, that is, I'd like to create a graph such as the one that you get from the option plot (nmds_model, type=t, display=c(species)) but instead of getting just the names of the species, I'd like to see dots of different sizes that would refer to the abundance of each of the species, is that possible at all? I know you can do it with CANOCO but wanted to ask if there is a way to do it in R. I have searched the internet and found something that looks like what I want to do (enclosed to the mail) but haven't found the way to do it. I have already done an Indicator Species Analysis with the multipatt function. That gives me information about the species that are related to some treatments but here I'm just looking for the species with more and less biomass in each treatment. Thank you very much!! Barbara -- Barbara Baraibar Post-doctoral scholar - Weed and Applied Plant Ecology Plant Sciences Department Penn State University University Park, Pennsylvania 16802 web-site:http://www.weedecologypsu.com ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology -- In God we trust, all others bring data. [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] Plot NMDS with size of the points related to abundance
After clicking send I remembered that you might want to scale circle sizes according to their area, not radius (which is the default to draw). Then I went to see the link Sarah posted and it deals with this, too (great minds think alike? :) ). Cheers, Roman On Tue, Mar 17, 2015 at 4:39 PM, Roman Luštrik roman.lust...@gmail.com wrote: Assuming you're working with metaMDS from vegan, it's trivial to extract NMDS scores, add some variable and plot the data. The following code would be easy to translate into a generic function. library(vegan) data(dune) sol - metaMDS(dune) # add some variable that will correspond to size of points spc - as.data.frame(cbind(sol$species, mysize = runif(nrow(sol$species pts - as.data.frame(sol$points) library(ggplot2) ggplot(spc, aes(x = MDS1, y = MDS2)) + theme_bw() + geom_point(aes(size = mysize), pch = 1) + geom_point(data = pts, color = red) Cheers, Roman On Tue, Mar 17, 2015 at 4:23 PM, Barbara Baraibar Padro bu...@psu.edu wrote: Hello list, I am analyzing species composition of weeds in 12 cover crop treatments and a fallow plot. I have been using nmds and got good results and no problems with it (although after some fighting!). My data is a matrix of biomass values sorted by species. Now I'd like to know which of my species are contributing with more biomass to the community in each treatment, that is, I'd like to create a graph such as the one that you get from the option plot (nmds_model, type=t, display=c(species)) but instead of getting just the names of the species, I'd like to see dots of different sizes that would refer to the abundance of each of the species, is that possible at all? I know you can do it with CANOCO but wanted to ask if there is a way to do it in R. I have searched the internet and found something that looks like what I want to do (enclosed to the mail) but haven't found the way to do it. I have already done an Indicator Species Analysis with the multipatt function. That gives me information about the species that are related to some treatments but here I'm just looking for the species with more and less biomass in each treatment. Thank you very much!! Barbara -- Barbara Baraibar Post-doctoral scholar - Weed and Applied Plant Ecology Plant Sciences Department Penn State University University Park, Pennsylvania 16802 web-site:http://www.weedecologypsu.com ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology -- In God we trust, all others bring data. -- In God we trust, all others bring data. [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology