Showing groups on a scatter plot for an ordination using ggplot2 (CC079)

  Рет қаралды 14,546

Riffomonas Project

Riffomonas Project

Күн бұрын

Пікірлер: 46
@hudgehug
@hudgehug 2 жыл бұрын
Really you deserve all the best ... Clear Easy magnificent amount of information..... i am new to R but i am able to follow you with no difficulties.... Thank you again
@Riffomonas
@Riffomonas 2 жыл бұрын
Thanks Shady! I’m glad you find the channel helpful
@Riffomonas
@Riffomonas 3 жыл бұрын
Which of the ordination do you like better: the base version with nothing added, adding the centroid, the star plot, adding an ellipse, contour plot? For bonus points see if you can add ellipses to the star plot!
@rishikeshdash12
@rishikeshdash12 2 жыл бұрын
Sir, is there any Bonus video where it was explained for how to add ellipse to the star plot?
@Riffomonas
@Riffomonas 2 жыл бұрын
@@rishikeshdash12 All you'd have to do is add geom_ellipse like we did for the normal ordination.
@rishikeshdash12
@rishikeshdash12 2 жыл бұрын
@@Riffomonas got it sir. Thank you so much
@ja_plants
@ja_plants 3 жыл бұрын
Awesome tutorial, I got it to work with my own data! Woohoo!
@Riffomonas
@Riffomonas 3 жыл бұрын
Fantastic! That's great to hear - can't tell you how happy it makes me to get news like this :)
@N1loon
@N1loon 3 жыл бұрын
Hey, thank you for this very informative video! One question: At around 11:18, you say that it's possible to conduct a statistical test to see if the differences between the centroids of the three groups are significant or not. Can you elaborate what specific test you would have in mind for this?
@Riffomonas
@Riffomonas 3 жыл бұрын
Next week I'll demo how to do this using the adonis function from the vegan package. It's also known as amova, permanova, and np-amova
@N1loon
@N1loon 3 жыл бұрын
@@Riffomonas Looking forward to it!
@Riffomonas
@Riffomonas 3 жыл бұрын
It's up! kzbin.info/www/bejne/Z3a3c5qYjdFgeK8
@N1loon
@N1loon 3 жыл бұрын
@@Riffomonas Great work! Thank you :)
@hannahhayes958
@hannahhayes958 3 жыл бұрын
Does anyone know how to run statiatics for this? How do we test if the elipses are statistically different from each other.
@Riffomonas
@Riffomonas 3 жыл бұрын
Hi Hannah - be sure to watch this episode kzbin.info/www/bejne/Z3a3c5qYjdFgeK8
@rishikeshdash12
@rishikeshdash12 2 жыл бұрын
Thank you sir for great explanation regarding different way of plotting in ordination. It helps alot☺😇
@Riffomonas
@Riffomonas 2 жыл бұрын
I’m so glad to hear that! Thanks for watching 🤓
@rishikeshdash12
@rishikeshdash12 2 жыл бұрын
@@Riffomonas you're welcome sir
@PhilippusCesena
@PhilippusCesena 2 жыл бұрын
Very useful! Thank you!
@Riffomonas
@Riffomonas 2 жыл бұрын
Thanks Philippus! 🤓
@tinabui-bullock1971
@tinabui-bullock1971 3 жыл бұрын
Is there a way to add a third axis to the plot where data points are aligned to units of time?
@Riffomonas
@Riffomonas 3 жыл бұрын
Hi Tina - if you were to order the points with fct_reorder by the third axis you could adjust what shows up where in the layering. I'm not a big fan of trying to build 3d into a 2d medium like a this figure since we can't see in 3d on a 2d image and all of the various work arounds always seem to be less than desirable.
@betzabeatencio5777
@betzabeatencio5777 3 жыл бұрын
Great set of tutorials, thanks for these videos.. Maybe I missed it but why you used NMDS, and not PCoA in this case? thanks!!
@Riffomonas
@Riffomonas 3 жыл бұрын
Thanks! I find that for the same number of dimensions, NMDS explains more of the variation in the data than PCoA
@rishikeshdash12
@rishikeshdash12 2 жыл бұрын
Sir, how can I increase the width of that Line Which Connect Centroid and Points.
@Riffomonas
@Riffomonas 2 жыл бұрын
Try size=2 in the geom function
@rishikeshdash12
@rishikeshdash12 2 жыл бұрын
@@Riffomonas you mean inside geom_segment ?
@rishikeshdash12
@rishikeshdash12 2 жыл бұрын
like this, can we do same for PCoA plots.
@Riffomonas
@Riffomonas 2 жыл бұрын
Tha is for watching! Yep. You can do it for any ggplot object
@rishikeshdash12
@rishikeshdash12 2 жыл бұрын
Ok Thank You sir
@SuperCakeable
@SuperCakeable 3 жыл бұрын
Thank you for this video! I'm struggling to get r to recognise my groups, it seems to just draw an ellipses around the whole data rather than grouping it. So you know why this might be happening? Thanks again!
@Riffomonas
@Riffomonas 3 жыл бұрын
One thing to double check is that you are defining the groups within the aes function and not in the main function call (eg ggplot(data, aes(x,y,color=group)) %>% geom_point() rather than geom_point(color=“black”)
@cailawrance8369
@cailawrance8369 2 жыл бұрын
Nice tutorial! Thanks a lot, sir! Meanwhile, I have a question, and it would be appreciated if you could answer me when you are free. The question is: how can I cluster a group of observant's data which are over 1 thousand? This 1000 data can be categorized into 10 groups. My idea is probably I can present and point up those groups on the figure rather than 1000 data. Yet, I am not sure how I can do that. Does it make sense if I just center those values within the group (average value)? Thanks a lot!!!
@Riffomonas
@Riffomonas 2 жыл бұрын
If you want to do it with an ordination maybe you could include error bars, ellipses, or convex hulls to indicate the range. Alternatively, I’d tell you to look at the more recent episodes where I showed alternatives to depicting distances with ordinations.
@cailawrance8369
@cailawrance8369 2 жыл бұрын
​@@Riffomonas Ok Sir, thank you so much for your quick reply!
@cailawrance8369
@cailawrance8369 2 жыл бұрын
@@Riffomonas Could you give me the links to that episodes? thank you so much!
@jessrobson3029
@jessrobson3029 2 жыл бұрын
Is it possible to have an ellipse around healthy and not the other two? If so, how would this be accomplished? This has been very helpful for me, thank you so much!
@Riffomonas
@Riffomonas 2 жыл бұрын
Hey Jess- I think I’d maybe try giving a second data frame for just the data you want grouped to the stat function and see if that works. Interesting question!
@jerichocarena4866
@jerichocarena4866 2 жыл бұрын
Hello! I’m conducting a metagenome analysis of gut microbiota. I have a total of 196 samples, however, when I subjected their relative abundance to NMDS to generate cluster dendogram and ordination plot, the stress level is always x10-5 and thus the ordination plot appeared obscure. Is there any way I can resolve this?
@Riffomonas
@Riffomonas 2 жыл бұрын
Thanks for watching! I suspect you might have some samples that are super different from the others? What happens if you remove those?
@geigercounter120
@geigercounter120 2 жыл бұрын
Great guide. I must admit, I've 'borrowed' some of your code to generate similar plots in my own work :). FWIW, the guidance for the vegan package refers to something called 'spiderplots' instead of 'starplots'. Go with whichever suits I guess!
@Riffomonas
@Riffomonas 2 жыл бұрын
Glad it helped! Thanks for watching
@WahranRai
@WahranRai 2 жыл бұрын
Pipe is not necessary ! Keep the code simple, meaningful and understandable even by python progarmmers
@Riffomonas
@Riffomonas 2 жыл бұрын
I guess we’ll have to agree to disagree 😆. Many of us think it makes the code easier to read and maintain
Revisiting and critiquing a scatterplot in R with ggplot2 (CC078)
28:54
Riffomonas Project
Рет қаралды 6 М.
Deadpool family by Tsuriki Show
00:12
Tsuriki Show
Рет қаралды 7 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 21 МЛН
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 29 МЛН
Recreating a Venn diagram with ggplot2 in R as a scatter plot (CC314)
24:52
Ordination using NMDS (Non-metric multidimensional scaling)
23:09
Rob K Statistics
Рет қаралды 26 М.
This Video is AI Generated! SORA Review
16:41
Marques Brownlee
Рет қаралды 3,2 МЛН
Creating a barplot with error bars using ggplot2 (CC088)
22:18
Riffomonas Project
Рет қаралды 12 М.