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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:12:38+00:00 2026-06-05T18:12:38+00:00

I have a data frame with two qualitative variables (Q1, Q2) which are both

  • 0

I have a data frame with two qualitative variables (Q1, Q2) which are both measured on a scale of LOW, MEDIUM, HIGH and a continuous variable CV on a scale 0-100.

s = 5
trial <- data.frame(id = c(1:s), 
                Q1 = ordered(sample(c("LOW","MED","HIGH"),size=s,replace=T)), 
                Q2 = ordered(sample(c("LOW","MED","HIGH"),size=s,replace=T)), 
                CV = runif(s,0,100))

I need to use ggplot to show a faceted plot (preferably a horizontal boxplot/jitter) of the continous variable for each qualitative variable (x2) for each level (x3). This would result in a 3 x 2 layout.

As I’m very new to ggplot I’m unsure how this should be achieved. I’ve played with qplot and and can’t work out how to control the facets to display both Q1 and Q2 boxplots on the same chart!!

Do I need to run multiple qplots to the same window (in base I would use par to control layout) or can it be achieved from a single command. Or should I try to melt the data twice?

trial = rbind(data.frame(Q = "Q1",Level = trial[,2], CV = trial[,4]),
          data.frame(Q = "Q2",Level = trial[,3], CV = trial[,4]))

I’ll keep trying and hope somebody can provide some hints in the meantime.

  • 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-05T18:12:40+00:00Added an answer on June 5, 2026 at 6:12 pm

    I’m not entirely clear on what you want, but maybe this helps:

    ggplot(trial, aes(Level, CV)) + 
       geom_boxplot() + 
       geom_jitter() + 
       facet_wrap(~Q) + 
       coord_flip() 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say I have a data frame with two variables x & y and
I have a data frame with stock data (date, symbol, high, low, open, close,
I have a data frame with two columns. First column contains categories such as
I have the following data. df = data.frame(email_one=c(one@gkn.com,two@wern.com,three@fu.cin, four@huo.com,five@hoi.com), email_two=c(ten@hoinse.com, four@huo.com,two@wern.com,five@hoi.com,six@ihoio.com)) I'm wondering if
I have data frame with some numerical variables and some categorical factor variables. The
I have a data frame with two columns (data will not always be identical).
I have two data.frame s in R , each indexed by date. One is
I have a data frame the first columns of which are a sample ID
I have a semi-melted data frame that looks like this: head(final_melt) Group Source variable
I have a data.frame in R. I want to try two different conditions on

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.