R programming: Graphs

0 votes

This is my R code, I'm using the output to make some line graphs

    f    x  N       y           sd         se         ci         
1  Carla 1  5 0.577437500 0.538098341 0.240644894 0.668137337
2  Carla 2 21 1.975978653 3.258871642 0.711144094 1.483420586
3  Carla 3  8 1.217090357 1.936489842 0.684652549 1.618946022
4  Carla 4  6 0.004543219 0.002500954 0.001021010 0.002624590
5   Liam 1  4 0.356406250 0.203422619 0.101711309 0.323690780
6   Liam 2  8 5.164708412 5.169434477 1.827671087 4.321755376
7   Liam 3  4 0.019294020 0.002592634 0.001296317 0.004125459
8    Meg 1  3 0.337395833 0.383621255 0.221483835 0.952968025
9    Meg 2 11 2.218085777 3.889646592 1.172772574 2.613100136
10   Meg 3  3 2.239833477 3.810413346 2.199943171 9.465591491
11   Meg 4  3 0.004317894 0.002512864 0.001450803 0.006242301

And I tried making line graphs thru the following code:

# Standard error of the mean
ggplot(dfc, aes(x=x, y=y, colour=f)) + 
    geom_errorbar(aes(ymin=y-se, ymax=y+se), width=.1) +
    geom_line() +
    geom_point()

# The errorbars overlapped, so use position_dodge to move them horizontally
pd <- position_dodge(.1) # move them .05 to the left and right

ggplot(dfc, aes(x=x, y=y, colour=f)) + 
    geom_errorbar(aes(ymin=y-se, ymax=y+se), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)

I want to know if its possible to highlight the area occupied by the standard error

Feb 21 in Data Analytics by Sophie may
• 9,050 points
15 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Try this:

ggplot(dfc, aes(x=x, y=y, colour=f, fill=f, ymin=y-se, ymax=y+se)) + 
  geom_ribbon(aes(colour=NULL),alpha=0.5) +
  geom_errorbar(width=.1) +
  geom_line() +
  geom_point() 
answered Feb 21 by Tyrion anex
• 8,280 points

Related Questions In Data Analytics

0 votes
1 answer

Plotting multiple graphs on the same page in R

If you want to plot 4 graphs ...READ MORE

answered Mar 27, 2018 in Data Analytics by Bharani
• 4,550 points
29 views
0 votes
1 answer

What are the rules to define a variable name in R programming language?

A variable name in R programming language ...READ MORE

answered Sep 7, 2018 in Data Analytics by zombie
• 3,690 points
58 views
0 votes
1 answer

Why should I adopt R programming

R Programming is the best mechanism for ...READ MORE

answered Oct 29, 2018 in Data Analytics by Maverick
• 10,000 points
12 views
0 votes
1 answer

Error: could not find function - R Programming

This error usually occurs when a package ...READ MORE

answered Oct 29, 2018 in Data Analytics by Maverick
• 10,000 points
110 views
0 votes
1 answer

R programming: Unexpected symbol error

Format your code this way: myfunction <- function() ...READ MORE

answered Dec 17, 2018 in Data Analytics by Sophie may
• 9,050 points
94 views
0 votes
1 answer

R Programming error in 'fert'

You're using a factor: fert <- factor(c(50,20,10,10,20,50)) levels(fert) #[1] ...READ MORE

answered Dec 27, 2018 in Data Analytics by Sophie may
• 9,050 points
33 views
0 votes
1 answer

R Programming: Market Basket Analysis Error

The basket.sorted() has less than 5 rules. Refer ...READ MORE

answered Feb 11 in Data Analytics by Sophie may
• 9,050 points
60 views
0 votes
1 answer

R Programming: regexpr error

The below code will help: gregexpr("D", x) # [[1]] # ...READ MORE

answered Feb 21 in Data Analytics by Tyrion anex
• 8,280 points
15 views
0 votes
1 answer

R programming: How to subset data and plot graphs in R?

You can create a grouping variable depending ...READ MORE

answered Feb 18 in Data Analytics by Tyrion anex
• 8,280 points
40 views
0 votes
1 answer

R programming error

Alright, you can either use gsub to match the ...READ MORE

answered Dec 18, 2018 in Data Analytics by Tyrion anex
• 8,280 points
10 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.