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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:43:11+00:00 2026-06-14T03:43:11+00:00

I have a data file that looks like this: x ys ———————> 1 20

  • 0

I have a data file that looks like this:

x   ys --------------------->
1   20   25   30   12   22   12
2   12    9   12   32   12 
3   33   12   11    6    1
4    5   10   41   12    3
5    7   81   12   31    8   3   4   11

I’d like to make a scatter plot with one x value and multiple y values (ys). I was trying to use reshape with melt, but I couldn’t get the proper data structure created to make this plot. How can I do this in R and plot with ggplot? Thanks for the help.

  • 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-14T03:43:12+00:00Added an answer on June 14, 2026 at 3:43 am

    So what did not work with melt? And what Problems did you have with geom_point()? Hard to say if this is what you want:

    library( "reshape2" )
    library( "ggplot2" )
    
    df <- data.frame( x = rnorm(20), ya = rnorm(20), yb = rnorm(20), yc = rnorm(20) )
    df <- melt(df, id.vars="x", variable.name="class", value.name="y")
    
    ggplot( df, aes( x = x, y = y) ) +
      geom_point( aes(colour = class) )
    
    ggplot( df, aes( x = x, y = y) ) +
      geom_point() +
      facet_wrap( "class" )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a data file that looks like this: xyz123 2.000 -0.3974 0.0 hij123
I have a large ARFF file with data that looks something like this: 555,2011-03-13
I have data stored in a csv file that looks like this: Date,BLOCK,,Wood,Miscellaneous,,Totals,MO Saturday,4055-RU,4055-AR,4091,1139,1158,,100
I have a file that is about 100Mb that looks like this: #meta data
Basically I have an XML file that looks like this: <?xml version=1.0 encoding=UTF-8?> <data>
I have an XML data file that looks like this: <Sales> <Store Number=8 Date=2012-08-20T03:00:00>
I have some data in a text file that looks like this: 1895723957 8599325893
I have an XML file that looks something like this: <product> <modelNumber>Data</modelNumber> <salePrice>Data</salePrice> </product>
I have a json file that looks like this: { status: 200, data: {
I have an xml file that looks like this: <args> <sometag value=abc /> <anothertag

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.