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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:57:25+00:00 2026-06-18T12:57:25+00:00

Here is the type of data that I’m importing as a csv file: RPID

  • 0

Here is the type of data that I’m importing as a csv file:

RPID    mm  ID  Time    Freq    Freq.1  Freq.2
RPO483  1   B6AC    5   23301   30512   
RPO483  1   B6AC    25  19      17  
RPO244  1   B6C     5   14889   20461   
RPO244  1   B6C     25  81      86  
RPO876  1   G3G3A   5   106760  59950   103745
RPO876  1   G3G3A   25  4578    38119   37201
RPO876  7   F3G3A   5   205803  148469  173580
RPO876  7   F3G3A   25  28648   30321   26454
RPO939  7   F3E324A 5   242285      
RPO939  7   F3E324A 25  42837       
RPO934  7   F3E325A 5   242001  129272  112371
RPO934  7   F3E325A 25  73057   58685   66582

For each “ID”, I’d like to generate a boxplot for values in columns “Freq”, “Freq.1” and “Freq.2”. However, currently I’m only able to successfully plot one Y value — for example:

dataset <- read.csv("~/R/dataset.csv")
library(ggplot2)
p <- ggplot(dataset) 
p + geom_boxplot(aes(x=ID, y=Freq, color=mm))

I’ve tried something like y=c(Freq,Freq.1,Freq.2), but this results in the following:

Error: Aesthetics must either be length one, or the same length as the dataProblems:ID

I’m sure there is a simple solution to this, but as I am very new to R, I can’t tell
if it is a problem of wrong data format, wrong syntax, wrong package or something else entirely.

Any help would be greatly appreciated !

  • 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-18T12:57:26+00:00Added an answer on June 18, 2026 at 12:57 pm

    You need to reshape the data in order to plot.

    First I read your data. Note that you have some NA values.

    dat <- read.table(text = '
    RPID    mm  ID  Time    Freq    Freq.1  Freq.2
    RPO483  1   B6AC    5   23301   30512   
    RPO483  1   B6AC    25  19      17  
    RPO244  1   B6C     5   14889   20461   
    RPO244  1   B6C     25  81      86  
    RPO876  1   G3G3A   5   106760  59950   103745
    RPO876  1   G3G3A   25  4578    38119   37201
    RPO876  7   F3G3A   5   205803  148469  173580
    RPO876  7   F3G3A   25  28648   30321   26454
    RPO939  7   F3E324A 5   242285      
    RPO939  7   F3E324A 25  42837       
    RPO934  7   F3E325A 5   242001  129272  112371
    RPO934  7   F3E325A 25  73057   58685   66582',head=T, fill=T)
    

    Using reshape2 for example

    library(reshape2)
    dat.m <- melt(dat,id.vars='ID', measure.vars=c('Freq','Freq.1','Freq.2'))
    library(ggplot2)
    p <- ggplot(dat.m) +
          geom_boxplot(aes(x=ID, y=value, color=variable))
    

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to Microsoft's page on the datetimeoffset data type (see here ): A time
Here is an example of the type of data that I am trying to
Here is a table structure (e.g. test): Field Name Data Type id BIGINT (20)
Here's my ajax call: $.ajax({ url: 'url-to-json', type: 'POST', dataType: 'json', cache: 'false', data:
I have the following classes: Defect - represents a type of data that can
What I'm trying to do is create a new custom data type that behaves
Here are the DataTemplates: <DataTemplate DataType={x:Type data:Item} x:Key=ItemTemplate> <Border/> </DataTemplate> <DataTemplate DataType={x:Type data:StyleItem} x:Key=StyleItemTemplate>
I know that null is not a data type. But null can be only
I just want to know how can I add the data type here? Google
My code is using std::count() on a list of an abstract data type that

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.