Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8014081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:49:25+00:00 2026-06-04T19:49:25+00:00

Possible Duplicate: Create a bar graph with pre-summarized data using ggplot2 On ggplot2 reference

  • 0

Possible Duplicate:
Create a bar graph with pre-summarized data using ggplot2

On ggplot2 reference manual
http://had.co.nz/ggplot2/geom_bar.html

We can see that stacked bar charts are quite easy using the provided diamond data.

However, the dataset I am trying to use is different from the diamond data because mine is already summarized.

Attached is a minimal example of what I mean

   AgeGroup gender Level.of.Education  status count
1     18-25   male        High School married    10
2     18-25   male        High School  single    20
3     18-25   male            College married    25
4     18-25   male            College  single    10
5     18-25   male                PhD married    50
6     18-25   male                PhD  single     4
7     18-25   male                GED married    20
8     18-25   male                GED  single   100
9     18-25 female        High School married    20
10    18-25 female        High School  single    10
11    18-25 female            College married    30
12    18-25 female            College  single    60
13    18-25 female                PhD married    80
14    18-25 female                PhD  single    10
15    18-25 female                GED married     5
16    18-25 female                GED  single     2

Full dataset has timeframe as well so what I want to produce is a stacked bar graph showing number of married people and unmarried people overtime using “level of education” as fill on the bar.

Full dataset is so large that aggregate data like this is highly desired.

Your input would greatly help me. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T19:49:27+00:00Added an answer on June 4, 2026 at 7:49 pm

    you need stat='identity'.

    ggplot(dat, aes(x=status, y=count, fill=Level.of.Education)) +
        geom_bar(stat='identity')
    

    I’d also suggest faceting by gender:

    ggplot(dat, aes(x=status, y=count, fill=Level.of.Education)) +
        geom_bar(stat='identity') +
        facet_wrap(~gender)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Jquery:: Ajax powered progress bar? I need to create some kind of
Possible Duplicate: Difference of create Index by using include column or not using Edit:
Possible Duplicate: How to create Custom Ratings bar in Android The inbuilt rating bar
Possible Duplicate: Using ZXing to create an android barcode scanning app I know it
Possible Duplicate: How do I Create a Comma-Separated List using a SQL Query? I
Possible Duplicate: Create a date with T-SQL I've a data table that stores each
Possible Duplicate: Create instance of “Class” Using “Reflection” in JavaScript Java has Class.forName(XYZClass) to
Possible Duplicate: How do I create a nice-looking DMG for Mac OS X using
Possible Duplicate: Using ggplot2, can I insert a break in the axis? I'm using
Possible Duplicate: How can I create a Zerofilled value using JavaScript? I have to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.