Skip to content
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

Error when generating plot for "Gini coefficient" #389

Open
KashingTang opened this issue Nov 22, 2023 · 1 comment
Open

Error when generating plot for "Gini coefficient" #389

KashingTang opened this issue Nov 22, 2023 · 1 comment
Labels
tag:Methods Analysis and visualisation methods

Comments

@KashingTang
Copy link

🐛 Bug

I am using immunarch verison 0.9.0,
R version 4.3.2 (2023-10-31 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 11 x64 (build 22621)

Using the command " repDiversity" and "vis ", I can generate plots using methods like chao1, hill, div, inv.simp, d50.
But when I try to use the 'gini' method, I get an error.

Here is my code:

div_gini <- repDiversity(immdata$data, "gini")
vis(div_gini)

And I get the following error:

Error in UseMethod("vis") :
no applicable method for 'vis' applied to an object of class "c('immunr_gini', 'matrix', 'array')"

@vadimnazarov
Copy link
Contributor

Hi KashinTang,

Thank you, we are missing a plot for gini coefficient data. We will implement a plot in the next major version, which we are working on at the moment. For now, please consider using ggplot2 for this. E.g.,

ginic = repDiversity(immdata$data, "gini")
ginic = data.frame(Gini = ginic[,1], Sample = row.names(ginic))
qplot(x=Sample, y=Gini, data=ginic)

@vadimnazarov vadimnazarov added the tag:Methods Analysis and visualisation methods label Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tag:Methods Analysis and visualisation methods
Projects
None yet
Development

No branches or pull requests

2 participants