Regression line just in certain groups (ggplot2)












0















Hi I'm trying to add the regression line just to the Le and Aw groups. Try using subset but didnt work. Dont know what I may be doing wrong.
Here is my code:



# Set up the work directory in which all data is gonna be extracted
H1517 = read.csv("Test_Subsetv3.csv") #Change name of the file
# Load the ggplot2 package
library(ggplot2) #Run to create plots
library(grid)
library(cowplot)
library(gridExtra)

test <- ggplot(H1517,aes(PI,FE,color=factor(Seg)))+
geom_point()+
geom_smooth(data=subset(H1517,Seg==Le |
Seg==Aw),aes(PI,FE,color=factor(Seg)),method=lm,se=FALSE)

test


Then I get the next error:




Error in eval(e, x, parent.frame()) : object 'Le' not found




test  



Error: object 'test' not found




Data in dput format.

The OP posted this example dataset in a comment.



H1517 <-
structure(list(FE = c(69.27030884, 60.62345885,
59.87889173, 69.27030884, 60.62345885, 59.87889173,
69.27030884, 60.62345885, 59.87889173, 71.11906144,
69.27030884, 60.62345885, 59.87889173, 61.88615029,
71.11906144, 69.27030884, 60.62345885, 59.87889173),
PI = c(0.203496781, 0.197520353, 0.209443661,
0.110640382, 0.116677419, 0.10343242, 0.299820599,
0.303724997, 0.261057467, 0.125785204, 0.237294948,
0.249327695, 0.275266774, 0.300414044, 0.283862484,
0.148747292, 0.13326041, 0.149232038),
Seg = structure(c(2L, 2L, 2L, 4L, 4L, 4L, 3L, 3L,
3L, 4L, 1L, 1L, 1L, 3L, 3L, 5L, 5L, 5L),
.Label = c("Aw", "Glu", "Le", "Pa", "Ra"),
class = "factor")), row.names = c(NA,
-18L), class = "data.frame")









share|improve this question

























  • Should it be subset(H1517, Seg=="Le" | Seg=="Aw")?

    – Lyngbakr
    Nov 21 '18 at 15:35













  • @Lyngbakr Or maybe subset(H1517, Seg %in% c("Le", "Aw")).

    – Rui Barradas
    Nov 21 '18 at 15:38






  • 2





    Can you post sample data? Please edit the question with the output of dput(H1517). Or, if it is too big with the output of dput(head(H1517, 20)).

    – Rui Barradas
    Nov 21 '18 at 15:53











  • FE PI Seg 69.27030884 0.203496781 Glu 60.62345885 0.197520353 Glu 59.87889173 0.209443661 Glu 69.27030884 0.110640382 Pa 60.62345885 0.116677419 Pa 59.87889173 0.10343242 Pa 69.27030884 0.299820599 Le 60.62345885 0.303724997 Le 59.87889173 0.261057467 Le 71.11906144 0.125785204 Pa 69.27030884 0.237294948 Aw 60.62345885 0.249327695 Aw 59.87889173 0.275266774 Aw 61.88615029 0.300414044 Le 71.11906144 0.283862484 Le 69.27030884 0.148747292 Ra 60.62345885 0.13326041 Ra 59.87889173 0.149232038 Ra

    – Ale
    Nov 21 '18 at 16:02













  • @RuiBarradas I try with your way and this came up: Error: mapping must be created by aes()

    – Ale
    Nov 21 '18 at 16:05
















0















Hi I'm trying to add the regression line just to the Le and Aw groups. Try using subset but didnt work. Dont know what I may be doing wrong.
Here is my code:



# Set up the work directory in which all data is gonna be extracted
H1517 = read.csv("Test_Subsetv3.csv") #Change name of the file
# Load the ggplot2 package
library(ggplot2) #Run to create plots
library(grid)
library(cowplot)
library(gridExtra)

test <- ggplot(H1517,aes(PI,FE,color=factor(Seg)))+
geom_point()+
geom_smooth(data=subset(H1517,Seg==Le |
Seg==Aw),aes(PI,FE,color=factor(Seg)),method=lm,se=FALSE)

test


Then I get the next error:




Error in eval(e, x, parent.frame()) : object 'Le' not found




test  



Error: object 'test' not found




Data in dput format.

The OP posted this example dataset in a comment.



H1517 <-
structure(list(FE = c(69.27030884, 60.62345885,
59.87889173, 69.27030884, 60.62345885, 59.87889173,
69.27030884, 60.62345885, 59.87889173, 71.11906144,
69.27030884, 60.62345885, 59.87889173, 61.88615029,
71.11906144, 69.27030884, 60.62345885, 59.87889173),
PI = c(0.203496781, 0.197520353, 0.209443661,
0.110640382, 0.116677419, 0.10343242, 0.299820599,
0.303724997, 0.261057467, 0.125785204, 0.237294948,
0.249327695, 0.275266774, 0.300414044, 0.283862484,
0.148747292, 0.13326041, 0.149232038),
Seg = structure(c(2L, 2L, 2L, 4L, 4L, 4L, 3L, 3L,
3L, 4L, 1L, 1L, 1L, 3L, 3L, 5L, 5L, 5L),
.Label = c("Aw", "Glu", "Le", "Pa", "Ra"),
class = "factor")), row.names = c(NA,
-18L), class = "data.frame")









share|improve this question

























  • Should it be subset(H1517, Seg=="Le" | Seg=="Aw")?

    – Lyngbakr
    Nov 21 '18 at 15:35













  • @Lyngbakr Or maybe subset(H1517, Seg %in% c("Le", "Aw")).

    – Rui Barradas
    Nov 21 '18 at 15:38






  • 2





    Can you post sample data? Please edit the question with the output of dput(H1517). Or, if it is too big with the output of dput(head(H1517, 20)).

    – Rui Barradas
    Nov 21 '18 at 15:53











  • FE PI Seg 69.27030884 0.203496781 Glu 60.62345885 0.197520353 Glu 59.87889173 0.209443661 Glu 69.27030884 0.110640382 Pa 60.62345885 0.116677419 Pa 59.87889173 0.10343242 Pa 69.27030884 0.299820599 Le 60.62345885 0.303724997 Le 59.87889173 0.261057467 Le 71.11906144 0.125785204 Pa 69.27030884 0.237294948 Aw 60.62345885 0.249327695 Aw 59.87889173 0.275266774 Aw 61.88615029 0.300414044 Le 71.11906144 0.283862484 Le 69.27030884 0.148747292 Ra 60.62345885 0.13326041 Ra 59.87889173 0.149232038 Ra

    – Ale
    Nov 21 '18 at 16:02













  • @RuiBarradas I try with your way and this came up: Error: mapping must be created by aes()

    – Ale
    Nov 21 '18 at 16:05














0












0








0








Hi I'm trying to add the regression line just to the Le and Aw groups. Try using subset but didnt work. Dont know what I may be doing wrong.
Here is my code:



# Set up the work directory in which all data is gonna be extracted
H1517 = read.csv("Test_Subsetv3.csv") #Change name of the file
# Load the ggplot2 package
library(ggplot2) #Run to create plots
library(grid)
library(cowplot)
library(gridExtra)

test <- ggplot(H1517,aes(PI,FE,color=factor(Seg)))+
geom_point()+
geom_smooth(data=subset(H1517,Seg==Le |
Seg==Aw),aes(PI,FE,color=factor(Seg)),method=lm,se=FALSE)

test


Then I get the next error:




Error in eval(e, x, parent.frame()) : object 'Le' not found




test  



Error: object 'test' not found




Data in dput format.

The OP posted this example dataset in a comment.



H1517 <-
structure(list(FE = c(69.27030884, 60.62345885,
59.87889173, 69.27030884, 60.62345885, 59.87889173,
69.27030884, 60.62345885, 59.87889173, 71.11906144,
69.27030884, 60.62345885, 59.87889173, 61.88615029,
71.11906144, 69.27030884, 60.62345885, 59.87889173),
PI = c(0.203496781, 0.197520353, 0.209443661,
0.110640382, 0.116677419, 0.10343242, 0.299820599,
0.303724997, 0.261057467, 0.125785204, 0.237294948,
0.249327695, 0.275266774, 0.300414044, 0.283862484,
0.148747292, 0.13326041, 0.149232038),
Seg = structure(c(2L, 2L, 2L, 4L, 4L, 4L, 3L, 3L,
3L, 4L, 1L, 1L, 1L, 3L, 3L, 5L, 5L, 5L),
.Label = c("Aw", "Glu", "Le", "Pa", "Ra"),
class = "factor")), row.names = c(NA,
-18L), class = "data.frame")









share|improve this question
















Hi I'm trying to add the regression line just to the Le and Aw groups. Try using subset but didnt work. Dont know what I may be doing wrong.
Here is my code:



# Set up the work directory in which all data is gonna be extracted
H1517 = read.csv("Test_Subsetv3.csv") #Change name of the file
# Load the ggplot2 package
library(ggplot2) #Run to create plots
library(grid)
library(cowplot)
library(gridExtra)

test <- ggplot(H1517,aes(PI,FE,color=factor(Seg)))+
geom_point()+
geom_smooth(data=subset(H1517,Seg==Le |
Seg==Aw),aes(PI,FE,color=factor(Seg)),method=lm,se=FALSE)

test


Then I get the next error:




Error in eval(e, x, parent.frame()) : object 'Le' not found




test  



Error: object 'test' not found




Data in dput format.

The OP posted this example dataset in a comment.



H1517 <-
structure(list(FE = c(69.27030884, 60.62345885,
59.87889173, 69.27030884, 60.62345885, 59.87889173,
69.27030884, 60.62345885, 59.87889173, 71.11906144,
69.27030884, 60.62345885, 59.87889173, 61.88615029,
71.11906144, 69.27030884, 60.62345885, 59.87889173),
PI = c(0.203496781, 0.197520353, 0.209443661,
0.110640382, 0.116677419, 0.10343242, 0.299820599,
0.303724997, 0.261057467, 0.125785204, 0.237294948,
0.249327695, 0.275266774, 0.300414044, 0.283862484,
0.148747292, 0.13326041, 0.149232038),
Seg = structure(c(2L, 2L, 2L, 4L, 4L, 4L, 3L, 3L,
3L, 4L, 1L, 1L, 1L, 3L, 3L, 5L, 5L, 5L),
.Label = c("Aw", "Glu", "Le", "Pa", "Ra"),
class = "factor")), row.names = c(NA,
-18L), class = "data.frame")






r ggplot2 regression






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 21 '18 at 16:17









Rui Barradas

18k51832




18k51832










asked Nov 21 '18 at 15:29









AleAle

123




123













  • Should it be subset(H1517, Seg=="Le" | Seg=="Aw")?

    – Lyngbakr
    Nov 21 '18 at 15:35













  • @Lyngbakr Or maybe subset(H1517, Seg %in% c("Le", "Aw")).

    – Rui Barradas
    Nov 21 '18 at 15:38






  • 2





    Can you post sample data? Please edit the question with the output of dput(H1517). Or, if it is too big with the output of dput(head(H1517, 20)).

    – Rui Barradas
    Nov 21 '18 at 15:53











  • FE PI Seg 69.27030884 0.203496781 Glu 60.62345885 0.197520353 Glu 59.87889173 0.209443661 Glu 69.27030884 0.110640382 Pa 60.62345885 0.116677419 Pa 59.87889173 0.10343242 Pa 69.27030884 0.299820599 Le 60.62345885 0.303724997 Le 59.87889173 0.261057467 Le 71.11906144 0.125785204 Pa 69.27030884 0.237294948 Aw 60.62345885 0.249327695 Aw 59.87889173 0.275266774 Aw 61.88615029 0.300414044 Le 71.11906144 0.283862484 Le 69.27030884 0.148747292 Ra 60.62345885 0.13326041 Ra 59.87889173 0.149232038 Ra

    – Ale
    Nov 21 '18 at 16:02













  • @RuiBarradas I try with your way and this came up: Error: mapping must be created by aes()

    – Ale
    Nov 21 '18 at 16:05



















  • Should it be subset(H1517, Seg=="Le" | Seg=="Aw")?

    – Lyngbakr
    Nov 21 '18 at 15:35













  • @Lyngbakr Or maybe subset(H1517, Seg %in% c("Le", "Aw")).

    – Rui Barradas
    Nov 21 '18 at 15:38






  • 2





    Can you post sample data? Please edit the question with the output of dput(H1517). Or, if it is too big with the output of dput(head(H1517, 20)).

    – Rui Barradas
    Nov 21 '18 at 15:53











  • FE PI Seg 69.27030884 0.203496781 Glu 60.62345885 0.197520353 Glu 59.87889173 0.209443661 Glu 69.27030884 0.110640382 Pa 60.62345885 0.116677419 Pa 59.87889173 0.10343242 Pa 69.27030884 0.299820599 Le 60.62345885 0.303724997 Le 59.87889173 0.261057467 Le 71.11906144 0.125785204 Pa 69.27030884 0.237294948 Aw 60.62345885 0.249327695 Aw 59.87889173 0.275266774 Aw 61.88615029 0.300414044 Le 71.11906144 0.283862484 Le 69.27030884 0.148747292 Ra 60.62345885 0.13326041 Ra 59.87889173 0.149232038 Ra

    – Ale
    Nov 21 '18 at 16:02













  • @RuiBarradas I try with your way and this came up: Error: mapping must be created by aes()

    – Ale
    Nov 21 '18 at 16:05

















Should it be subset(H1517, Seg=="Le" | Seg=="Aw")?

– Lyngbakr
Nov 21 '18 at 15:35







Should it be subset(H1517, Seg=="Le" | Seg=="Aw")?

– Lyngbakr
Nov 21 '18 at 15:35















@Lyngbakr Or maybe subset(H1517, Seg %in% c("Le", "Aw")).

– Rui Barradas
Nov 21 '18 at 15:38





@Lyngbakr Or maybe subset(H1517, Seg %in% c("Le", "Aw")).

– Rui Barradas
Nov 21 '18 at 15:38




2




2





Can you post sample data? Please edit the question with the output of dput(H1517). Or, if it is too big with the output of dput(head(H1517, 20)).

– Rui Barradas
Nov 21 '18 at 15:53





Can you post sample data? Please edit the question with the output of dput(H1517). Or, if it is too big with the output of dput(head(H1517, 20)).

– Rui Barradas
Nov 21 '18 at 15:53













FE PI Seg 69.27030884 0.203496781 Glu 60.62345885 0.197520353 Glu 59.87889173 0.209443661 Glu 69.27030884 0.110640382 Pa 60.62345885 0.116677419 Pa 59.87889173 0.10343242 Pa 69.27030884 0.299820599 Le 60.62345885 0.303724997 Le 59.87889173 0.261057467 Le 71.11906144 0.125785204 Pa 69.27030884 0.237294948 Aw 60.62345885 0.249327695 Aw 59.87889173 0.275266774 Aw 61.88615029 0.300414044 Le 71.11906144 0.283862484 Le 69.27030884 0.148747292 Ra 60.62345885 0.13326041 Ra 59.87889173 0.149232038 Ra

– Ale
Nov 21 '18 at 16:02







FE PI Seg 69.27030884 0.203496781 Glu 60.62345885 0.197520353 Glu 59.87889173 0.209443661 Glu 69.27030884 0.110640382 Pa 60.62345885 0.116677419 Pa 59.87889173 0.10343242 Pa 69.27030884 0.299820599 Le 60.62345885 0.303724997 Le 59.87889173 0.261057467 Le 71.11906144 0.125785204 Pa 69.27030884 0.237294948 Aw 60.62345885 0.249327695 Aw 59.87889173 0.275266774 Aw 61.88615029 0.300414044 Le 71.11906144 0.283862484 Le 69.27030884 0.148747292 Ra 60.62345885 0.13326041 Ra 59.87889173 0.149232038 Ra

– Ale
Nov 21 '18 at 16:02















@RuiBarradas I try with your way and this came up: Error: mapping must be created by aes()

– Ale
Nov 21 '18 at 16:05





@RuiBarradas I try with your way and this came up: Error: mapping must be created by aes()

– Ale
Nov 21 '18 at 16:05












1 Answer
1






active

oldest

votes


















0














This works for me.



test <- ggplot(H1517, aes(PI, FE, color = Seg)) +
geom_point() +
geom_smooth(data = subset(H1517, Seg %in% c("Le", "Aw")),
aes(PI, FE, color = Seg),
method = lm, se = FALSE)

test


enter image description here



Data.



H1517 <-
structure(list(FE = c(69.27030884, 60.62345885,
59.87889173, 69.27030884, 60.62345885, 59.87889173,
69.27030884, 60.62345885, 59.87889173, 71.11906144,
69.27030884, 60.62345885, 59.87889173, 61.88615029,
71.11906144, 69.27030884, 60.62345885, 59.87889173),
PI = c(0.203496781, 0.197520353, 0.209443661,
0.110640382, 0.116677419, 0.10343242, 0.299820599,
0.303724997, 0.261057467, 0.125785204, 0.237294948,
0.249327695, 0.275266774, 0.300414044, 0.283862484,
0.148747292, 0.13326041, 0.149232038),
Seg = structure(c(2L, 2L, 2L, 4L, 4L, 4L, 3L, 3L,
3L, 4L, 1L, 1L, 1L, 3L, 3L, 5L, 5L, 5L),
.Label = c("Aw", "Glu", "Le", "Pa", "Ra"),
class = "factor")), row.names = c(NA,
-18L), class = "data.frame")





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53415371%2fregression-line-just-in-certain-groups-ggplot2%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    This works for me.



    test <- ggplot(H1517, aes(PI, FE, color = Seg)) +
    geom_point() +
    geom_smooth(data = subset(H1517, Seg %in% c("Le", "Aw")),
    aes(PI, FE, color = Seg),
    method = lm, se = FALSE)

    test


    enter image description here



    Data.



    H1517 <-
    structure(list(FE = c(69.27030884, 60.62345885,
    59.87889173, 69.27030884, 60.62345885, 59.87889173,
    69.27030884, 60.62345885, 59.87889173, 71.11906144,
    69.27030884, 60.62345885, 59.87889173, 61.88615029,
    71.11906144, 69.27030884, 60.62345885, 59.87889173),
    PI = c(0.203496781, 0.197520353, 0.209443661,
    0.110640382, 0.116677419, 0.10343242, 0.299820599,
    0.303724997, 0.261057467, 0.125785204, 0.237294948,
    0.249327695, 0.275266774, 0.300414044, 0.283862484,
    0.148747292, 0.13326041, 0.149232038),
    Seg = structure(c(2L, 2L, 2L, 4L, 4L, 4L, 3L, 3L,
    3L, 4L, 1L, 1L, 1L, 3L, 3L, 5L, 5L, 5L),
    .Label = c("Aw", "Glu", "Le", "Pa", "Ra"),
    class = "factor")), row.names = c(NA,
    -18L), class = "data.frame")





    share|improve this answer




























      0














      This works for me.



      test <- ggplot(H1517, aes(PI, FE, color = Seg)) +
      geom_point() +
      geom_smooth(data = subset(H1517, Seg %in% c("Le", "Aw")),
      aes(PI, FE, color = Seg),
      method = lm, se = FALSE)

      test


      enter image description here



      Data.



      H1517 <-
      structure(list(FE = c(69.27030884, 60.62345885,
      59.87889173, 69.27030884, 60.62345885, 59.87889173,
      69.27030884, 60.62345885, 59.87889173, 71.11906144,
      69.27030884, 60.62345885, 59.87889173, 61.88615029,
      71.11906144, 69.27030884, 60.62345885, 59.87889173),
      PI = c(0.203496781, 0.197520353, 0.209443661,
      0.110640382, 0.116677419, 0.10343242, 0.299820599,
      0.303724997, 0.261057467, 0.125785204, 0.237294948,
      0.249327695, 0.275266774, 0.300414044, 0.283862484,
      0.148747292, 0.13326041, 0.149232038),
      Seg = structure(c(2L, 2L, 2L, 4L, 4L, 4L, 3L, 3L,
      3L, 4L, 1L, 1L, 1L, 3L, 3L, 5L, 5L, 5L),
      .Label = c("Aw", "Glu", "Le", "Pa", "Ra"),
      class = "factor")), row.names = c(NA,
      -18L), class = "data.frame")





      share|improve this answer


























        0












        0








        0







        This works for me.



        test <- ggplot(H1517, aes(PI, FE, color = Seg)) +
        geom_point() +
        geom_smooth(data = subset(H1517, Seg %in% c("Le", "Aw")),
        aes(PI, FE, color = Seg),
        method = lm, se = FALSE)

        test


        enter image description here



        Data.



        H1517 <-
        structure(list(FE = c(69.27030884, 60.62345885,
        59.87889173, 69.27030884, 60.62345885, 59.87889173,
        69.27030884, 60.62345885, 59.87889173, 71.11906144,
        69.27030884, 60.62345885, 59.87889173, 61.88615029,
        71.11906144, 69.27030884, 60.62345885, 59.87889173),
        PI = c(0.203496781, 0.197520353, 0.209443661,
        0.110640382, 0.116677419, 0.10343242, 0.299820599,
        0.303724997, 0.261057467, 0.125785204, 0.237294948,
        0.249327695, 0.275266774, 0.300414044, 0.283862484,
        0.148747292, 0.13326041, 0.149232038),
        Seg = structure(c(2L, 2L, 2L, 4L, 4L, 4L, 3L, 3L,
        3L, 4L, 1L, 1L, 1L, 3L, 3L, 5L, 5L, 5L),
        .Label = c("Aw", "Glu", "Le", "Pa", "Ra"),
        class = "factor")), row.names = c(NA,
        -18L), class = "data.frame")





        share|improve this answer













        This works for me.



        test <- ggplot(H1517, aes(PI, FE, color = Seg)) +
        geom_point() +
        geom_smooth(data = subset(H1517, Seg %in% c("Le", "Aw")),
        aes(PI, FE, color = Seg),
        method = lm, se = FALSE)

        test


        enter image description here



        Data.



        H1517 <-
        structure(list(FE = c(69.27030884, 60.62345885,
        59.87889173, 69.27030884, 60.62345885, 59.87889173,
        69.27030884, 60.62345885, 59.87889173, 71.11906144,
        69.27030884, 60.62345885, 59.87889173, 61.88615029,
        71.11906144, 69.27030884, 60.62345885, 59.87889173),
        PI = c(0.203496781, 0.197520353, 0.209443661,
        0.110640382, 0.116677419, 0.10343242, 0.299820599,
        0.303724997, 0.261057467, 0.125785204, 0.237294948,
        0.249327695, 0.275266774, 0.300414044, 0.283862484,
        0.148747292, 0.13326041, 0.149232038),
        Seg = structure(c(2L, 2L, 2L, 4L, 4L, 4L, 3L, 3L,
        3L, 4L, 1L, 1L, 1L, 3L, 3L, 5L, 5L, 5L),
        .Label = c("Aw", "Glu", "Le", "Pa", "Ra"),
        class = "factor")), row.names = c(NA,
        -18L), class = "data.frame")






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 21 '18 at 16:15









        Rui BarradasRui Barradas

        18k51832




        18k51832
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53415371%2fregression-line-just-in-certain-groups-ggplot2%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to change which sound is reproduced for terminal bell?

            Can I use Tabulator js library in my java Spring + Thymeleaf project?

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents