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

The Archive Base Latest Questions

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

I have a dataset with three factors ( Group =Between; Drug =Within; Session =Within)

  • 0

I have a dataset with three factors (Group=Between; Drug=Within; Session=Within) and one response variable (DEs2mPre). I am able to plot faceted boxplot using

qplot(Session, DEs2mPre, data = Dummy.Data, colour = Drug, facets=Group~., -geom="boxplot")

I have three groups and two levels of Drug, so I get nice 3X2 graph with 3 individual graphs for each group with two levels of drug over the sessions on each graph. However instead of boxplots I would like to see lines connecting the means on each session. When I change geom to geom="line", I get a mess of lines what looks like a line for every subject in the dataset and not a grouped (mean like) visualization of the data like what you would see with lineplot.CI (sciplot package).

Is there any way to do that in ggplot2?

Sorry I couldn’t add my graphs because I do not have enough “reputation points”.

Thanks for any help in advance.

  • 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-14T10:11:45+00:00Added an answer on June 14, 2026 at 10:11 am

    You get a mess of lines since ggplot connects all data points by default. You need to tell ggplot to use the mean of each group instead. The appropriate arguments are stat = "summary" and fun.y = "mean".

    qplot(Session, DEs2mPre, data = Dummy.Data, colour = Drug, facets = Group~.,
          stat = "summary", fun.y = "mean", geom = "line")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dataset with three variables. One continous independent variable, one continous dependent
I have a dataset consisting of a large collection of points in three dimensional
I have a dataset with one datatable. Now I want to set a filter
I have a dataset with multiple tables. One table in particular has one record
I have three tables from a dataset ds. var test0 = from a in
I have a UserControl with a Tab Control containing three tabs. Within the tabs
I have a dataset that looks like the one below, and I would like
I have DataSet which has 3 columns. Name - insurance comp. name - treatmentDate
I have a dataset with ~20M rows and I'm observing the following behavior. The
I have a DataSet , where in the first table and in the row

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.