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 7421081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:20:52+00:00 2026-05-29T08:20:52+00:00

Ok this should be easy but I can NOT figure it out. I have

  • 0

Ok this should be easy but I can NOT figure it out. I have data that is called avePrice (using diamond information in ggplot2):

Fair      Good Very Good   Premium     Ideal 
282.0    3050.5    2648.0    3181.0    1809.0

I want to plot, using the headings (the first row) on the x-axis as labels and the values (second row) on the y-axis.

This seems it should be easy in R but I cannot seem to figure it out!

I can do this

qplot(x=c("Fair", "Good", "Very Good", "Premium",  "Ideal"), y=avePrice, geom="bar", xlab="Diamond Cut", ylab="Average Price")

which works, but it would seem there HAS to be a simple way to do this without typing in the xlabels manually? Hopefully?

Thanks in advance… I’m expecting to feel dumb when someone points out how 🙂

Clarification: I know I can move the x=c(“Fair…”) stuff out of the qplot command and have it elsewhere, but I still am having to manually enter it at that point.

  • 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-05-29T08:20:53+00:00Added an answer on May 29, 2026 at 8:20 am

    You can directly plot this using ggplot2 without having to calculate the average prices by cut. Here is a one-liner

    qplot(cut, price, data = diamonds, stat = 'summary', fun.y = 'mean')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This should be easy, but I can't seem to figure it out... How can
This should probably be a super easy question but I can't figure out what
I'm trying something that should be pretty easy but i can't figure out how
An easy one, but I can't figure it out. I have a link called
This should be really easy but I can't figure out how to make it
Seems like this should be an easy task but I can't figure out how
This should be easy to find out but I can't seem to find it
This seems like it should have a super easy solution, but I just can't
Ok really easy I know but not for me... I can not figure this
So this should be a real easy question but I can't seem to find

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.