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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:24:10+00:00 2026-05-28T05:24:10+00:00

I am new in R and am trying to so some graphics using ggplot

  • 0

I am new in R and am trying to so some graphics using ggplot and a bit of reverse engineering. I have a data frame as:

> data
       experiments percentages
  1    A           72.11538
  2    A           90.62500
  3    A           91.52542
  4    B           94.81132
  5    B           96.95122
  6    B           98.95833
  7    C           83.75000
  8    C           84.84848
  9    C           91.12903

because A and B are similar experiments I do the following

data$experiments[data$experiments == "B"] = "A"

If I do now

ggplot(data, aes(x = experiments, y = percentages)) + geom_boxplot()

I get one box for A, one for C but still I get a label for B!

Is there any way of getting rid of B on the X axis?

Thanks a lot for your 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-05-28T05:24:11+00:00Added an answer on May 28, 2026 at 5:24 am

    I’m guessing that experiments in data is a factor. If you run str(data), I imagine that experiments is a factor with 3 levels: A, B, and C. By default, strings are turned into factors when a data frame is created.

    The idea of factors is that they represent a set of possible values, even if not all the possibilities are in the actual data. There are two ways to fix this.

    Convert the column to a string

    data$experiments <- as.character(data$experiments)
    

    Or remove the unused level in the factor

    data$experiments <- droplevels(data$experiment)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to insert some new objects into a firebird database using NHibernate. I
I am new to Java and have been trying to make some simple games
I am trying to some pretty basic RMI: // Context namingContext = new InitialContext();
I'm trying to use some of the new MFC feature pack controls on an
I'm trying to disassemble some of the DLL of the new WPF4 Beta2 framework.
I'm trying to put some specs around a new rails 3 project I am
I'm new to jQuery and i'm trying to write some code to go through
I'm learning Silverlight and am trying to ingest some new concepts. Just so I
I'm really new to ASP.NET MVC, and I'm trying to integrate some Javascript into
I am new to Haskell and trying to fiddle with some test cases I

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.