It looks like you are trying to add a ggplot2 element, but I'm not sure if you loaded the ggplot2 package.
library(ggplot2)
This can be a bit confusing, but packages in R can make use of other packages without loading them for you. There are various options for how packages depend on each other, but in this case, ggplot2 isn't loaded when DESeq2 is loaded.
When using "plotPCA" the way I did, I get the groups color coded and defined.
I've also tried the method you mentioned earlier but still getting the same result.
Wouldn't one also need to add
geom_point()
? There is nothing to draw an ellipse around.Also a group must be defined, around what the ellipse should be drawn?
something like this here?
Hi Assa,
When using "plotPCA" the way I did, I get the groups color coded and defined. I've also tried the method you mentioned earlier but still getting the same result.
Thank you
Hi Michael, Thanks for replying.
Even when loading ggplot2 separately just before applying PCA and adding the component, I get the same warning and no addition of ellipses.
Maybe I'm not even in the right direction in the method I'm using. Not sure how to solve this.
Best
Can you try this? It works fine for me, so I'm not sure what would be the issue.
Well, I tried it and it gave me the same error. I then just restarted R and now everything works.
Thank you for everything.
Best