Entering edit mode
10.0 years ago
Giffredo
▴
10
Hi,
I have a problem concerning R code. I looking for a method to reach a loading plot. I made a scatter plot of my data. I used this code so far:
library(labdsv)
PCO.1<-pco(data.dist, k=2)
PCO.1
plot.pco(PCO.1)
I hope I gave all the information. Thank you in advance,
Giffredo
How did you get
data.dist
? What is the problem/error?Did you try using just
plot(PCO.1)
instead ofplot.pco(PCO.1)
?Hi, thanks for the reply!
This is the code used to reach the data.dist:
I found this code in http://enterotype.embl.de/enterotypes.html
When the code below is inserted R gives me the coordinates to create a scatter plot without the coordinate to create the loading plot.
To be clearer:
I have same samples characterized by the % of different bacteria (the variables) present in them. I would like in the plot the samples and in the same time the bacteria in order to determine which samples are near to specific bacteria.
I tried the code
plot(PCO.1)
but I obtained the same results.. only the visualization of the samples.Have a nice day!
Giffredo
Umm, so you want a plot like this?
mm... no actually... I would like a plot without cluster (don't care about it mow) but I want in the plot the samples, like here labeled with black point, and also the bacteria/enterotype that determine the position in the plot of the samples... In this way I could say if a sample is colse to a specific bacteria or not..
The plot you are talking about is essentially a clustering plot. It is same as the plot that I linked except for the circle.
Just a suggestion, you are posting answers instead of comments. When you want to reply to my comments, you can click on the add reply button below my comment and reply.
By the way, the R package ade4 can do exactly what you want. You may have to play with it though. Some good tutorials are here.