-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update RDA example using plotLoadings #603
base: devel
Are you sure you want to change the base?
Conversation
#Create a plot | ||
plotLoadings(coef, ncomponents = 1, n = 20) + labs(x = "", y= "", title = "Top Taxa") + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm - why this doesn't use TreeSE directly (but coef)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, I think the plotted values are species scores (the coordinate of taxon in ordination space) instead of loadings (how much environmental variable, e.g, diagnosis affects the coordinates). The example has been incorrect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's because loadings are not stored in the "rotation" or "loadings" attribute (discussed in #604 )
It requires a wrapper I believe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a small problem in addRDA as it should store the results to this slot microbiome/mia#634
Let's keep this PR open until the mia is fixed
ggplot(df, aes(x = x, y = y)) + | ||
geom_bar(stat = "identity") + | ||
labs(x = "", y= "", title = "Top Taxa") + | ||
#Create a plot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usually, space after #
Small update to use new plotLoadings function.
Also shows how to retrieve and plot the loadings for RDA (microbiome/mia#604)
Created same plot as before (can change to plot all components and/or more examples using different parameters/methods)