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

Different Quantiles #7

Open
nithinmkp opened this issue Sep 16, 2020 · 4 comments
Open

Different Quantiles #7

nithinmkp opened this issue Sep 16, 2020 · 4 comments

Comments

@nithinmkp
Copy link

Can the plot be made with different quantiles? say 20% or with 10% bins?

@cortinah
Copy link
Contributor

cortinah commented Sep 19, 2020

I don't think gglorenz package can help you with this. But you could try something like this:

library(gglorenz)
data("billionaires")

q <- quantile(billionaires$TNW, seq(0, 1, 0.1))
q <- as.data.frame(q)
q$n <- as.numeric(sub("%","", rownames(q)))/100

q$q <- cumsum(q$q)/sum(q$q)

ggplot(q, aes(x=n,y=q)) +geom_path()

@nithinmkp
Copy link
Author

nithinmkp commented Sep 19, 2020 via email

@cortinah
Copy link
Contributor

ggplot(q, aes(x=n,y=q)) +geom_path() +geom_polygon()

@nithinmkp
Copy link
Author

nithinmkp commented Sep 19, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants