How to extract lower and upper bound in numeric format from a confidence interval string?How can I plot data with confidence intervals?R - Bootstrapped Confidence Interval - Obtain Parameters of Upper and Lower BoundsHow to display several bootstrap confidence intervals on one plotHow can confidence intervals be numerically visualized in corrplot()?How to compute confidence Interval of the fitted value via nls()rAmCharts Scattered plot with Upper and lower confidence interval around Fitted valuesextract confidence intervals from binomial test in Rhow to add confidence interval as coloured area to a boxplot of predicted values in ggplot2?How to extract values of confidence interval from ggplot2 stat summary in R?Plotting a ggplot() when having the confidence interval upper and lower values

What's the correct term describing the action of sending a brand-new ship out into its first seafaring trip?

From system of coupled ODEs to separable ODE

How to skip replacing first occurrence of a character in each line?

Can a magnetic field of an object be stronger than its gravity?

What happened to all the nuclear material being smuggled after the fall of the USSR?

Smooth switching between 12v batteries, with toggle switch

How can Iron Man's suit withstand this?

How do I write "Show, Don't Tell" as an Asperger?

Traffic law UK, pedestrians

Aligning object in a commutative diagram

Who operates delivery flights for commercial airlines?

Company did not petition for visa in a timely manner. Is asking me to work from overseas, but wants me to take a paycut

How to supress loops in a digraph?

Why is c4 bad when playing the London against a King's Indian?

Why did Hela need Heimdal's sword?

Reading two lines in piano

Will TSA allow me to carry a Continuous Positive Airway Pressure (CPAP)/sleep apnea device?

How were concentration and extermination camp guards recruited?

Payment instructions from HomeAway look fishy to me

Is the decompression of compressed and encrypted data without decryption also theoretically impossible?

Pay as you go Or Oyster card

What can plausibly explain many of my very long and low-tech bridges?

How is it possible that Gollum speaks Westron?

Should I "tell" my exposition or give it through dialogue?



How to extract lower and upper bound in numeric format from a confidence interval string?


How can I plot data with confidence intervals?R - Bootstrapped Confidence Interval - Obtain Parameters of Upper and Lower BoundsHow to display several bootstrap confidence intervals on one plotHow can confidence intervals be numerically visualized in corrplot()?How to compute confidence Interval of the fitted value via nls()rAmCharts Scattered plot with Upper and lower confidence interval around Fitted valuesextract confidence intervals from binomial test in Rhow to add confidence interval as coloured area to a boxplot of predicted values in ggplot2?How to extract values of confidence interval from ggplot2 stat summary in R?Plotting a ggplot() when having the confidence interval upper and lower values






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








9















Suppose a vector including some confidence intervals as below



confint <- c("[0.741 ; 2.233]", "[263.917 ; 402.154]", "[12.788 ; 17.975]", "[0.680 ; 2.450]", "[0.650 ; 1.827]", "[0.719 ; 2.190]")


I want to have two new vectors one including the lower Limits in numeric format as



lower <- c(0.741, 263.917, 12.788, 0.680, 0.650 , 0.719)


and othe including the upper Limits in numeric format like



upper <- c(2.233, 402.154, 17.975, 2.450, 1.827, 2.190)









share|improve this question







New contributor



Fateta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    9















    Suppose a vector including some confidence intervals as below



    confint <- c("[0.741 ; 2.233]", "[263.917 ; 402.154]", "[12.788 ; 17.975]", "[0.680 ; 2.450]", "[0.650 ; 1.827]", "[0.719 ; 2.190]")


    I want to have two new vectors one including the lower Limits in numeric format as



    lower <- c(0.741, 263.917, 12.788, 0.680, 0.650 , 0.719)


    and othe including the upper Limits in numeric format like



    upper <- c(2.233, 402.154, 17.975, 2.450, 1.827, 2.190)









    share|improve this question







    New contributor



    Fateta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      9












      9








      9


      1






      Suppose a vector including some confidence intervals as below



      confint <- c("[0.741 ; 2.233]", "[263.917 ; 402.154]", "[12.788 ; 17.975]", "[0.680 ; 2.450]", "[0.650 ; 1.827]", "[0.719 ; 2.190]")


      I want to have two new vectors one including the lower Limits in numeric format as



      lower <- c(0.741, 263.917, 12.788, 0.680, 0.650 , 0.719)


      and othe including the upper Limits in numeric format like



      upper <- c(2.233, 402.154, 17.975, 2.450, 1.827, 2.190)









      share|improve this question







      New contributor



      Fateta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      Suppose a vector including some confidence intervals as below



      confint <- c("[0.741 ; 2.233]", "[263.917 ; 402.154]", "[12.788 ; 17.975]", "[0.680 ; 2.450]", "[0.650 ; 1.827]", "[0.719 ; 2.190]")


      I want to have two new vectors one including the lower Limits in numeric format as



      lower <- c(0.741, 263.917, 12.788, 0.680, 0.650 , 0.719)


      and othe including the upper Limits in numeric format like



      upper <- c(2.233, 402.154, 17.975, 2.450, 1.827, 2.190)






      r






      share|improve this question







      New contributor



      Fateta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share|improve this question







      New contributor



      Fateta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share|improve this question




      share|improve this question






      New contributor



      Fateta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      asked May 27 at 12:31









      FatetaFateta

      826




      826




      New contributor



      Fateta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      New contributor




      Fateta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.
























          6 Answers
          6






          active

          oldest

          votes


















          11














          A base R solution



          lower = as.numeric(sub(".*?(\d+\.\d+).*", "\1", confint))
          upper = as.numeric(sub(".*\b(\d+\.\d+).*", "\1", confint))

          lower
          [1] 0.741 263.917 12.788 0.680 0.650 0.719
          upper
          [1] 2.233 402.154 17.975 2.450 1.827 2.190





          share|improve this answer
































            2














            mypattern <- '\[(\d+\.\d+) ; (\d+\.\d+)\]'
            as.numeric(gsub(mypattern, '\1', confint))
            as.numeric(gsub(mypattern, '\2', confint))





            share|improve this answer






























              1














              A different base R possibility could be:



              sapply(strsplit(confint, " ; ", fixed = TRUE), function(x) gsub("[^0-9.-]+", "\1", x) [1])
              sapply(strsplit(confint, " ; ", fixed = TRUE), function(x) gsub("[^0-9.-]+", "\1", x) [2])

              [1] "0.741" "263.917" "12.788" "0.680" "0.650" "0.719"
              [1] "2.233" "402.154" "17.975" "2.450" "1.827" "2.190"


              If you need it as a numeric vector:



              sapply(strsplit(confint, " ; ", fixed = TRUE), function(x) as.numeric(gsub("[^0-9.-]+", "\1", x)) [1])
              sapply(strsplit(confint, " ; ", fixed = TRUE), function(x) as.numeric(gsub("[^0-9.-]+", "\1", x)) [2])





              share|improve this answer

























              • @Ronak Shah I updated my post according some of your ideas. Thank you :)

                – tmfmnk
                May 27 at 12:59











              • I realised it needed some more tweaking to get exact output but I think it was a similar approach. +1 to you.

                – Ronak Shah
                May 27 at 13:21


















              1














              Meanwhile, I came up with another base R solution



              lower <- as.numeric(sub(".]*", "", sub(";.*", "", confint)))
              upper <- as.numeric(sub("].*", "", sub(".*;", "", confint)))

              lower
              [1] 0.741 263.917 12.788 0.680 0.650 0.719
              upper
              [1] 2.233 402.154 17.975 2.450 1.827 2.190


              Thank you all!






              share|improve this answer
































                0














                You can use functions from the stringr library.



                You can split strings with str_split() according a specific character (; in your case), then remove character with str_remove() ([ and ] in your case) and you will obtain what you want.



                str_remove(str_split_fixed(confint, ";", n = 2)[,1], '\[') %>% as.numeric()
                # [1] 0.741 263.917 12.788 0.680 0.650 0.719





                share|improve this answer
































                  0














                  A tidyverse solution:



                  library(dplyr)
                  library(tidyr)

                  df = data.frame(confint)
                  df = df %>%
                  mutate(confint = gsub("(\[|\])","",confint)) %>%
                  separate(confint,c("lower","upper"),";",convert=T)





                  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
                    );



                    );






                    Fateta is a new contributor. Be nice, and check out our Code of Conduct.









                    draft saved

                    draft discarded


















                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f56326130%2fhow-to-extract-lower-and-upper-bound-in-numeric-format-from-a-confidence-interva%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown

























                    6 Answers
                    6






                    active

                    oldest

                    votes








                    6 Answers
                    6






                    active

                    oldest

                    votes









                    active

                    oldest

                    votes






                    active

                    oldest

                    votes









                    11














                    A base R solution



                    lower = as.numeric(sub(".*?(\d+\.\d+).*", "\1", confint))
                    upper = as.numeric(sub(".*\b(\d+\.\d+).*", "\1", confint))

                    lower
                    [1] 0.741 263.917 12.788 0.680 0.650 0.719
                    upper
                    [1] 2.233 402.154 17.975 2.450 1.827 2.190





                    share|improve this answer





























                      11














                      A base R solution



                      lower = as.numeric(sub(".*?(\d+\.\d+).*", "\1", confint))
                      upper = as.numeric(sub(".*\b(\d+\.\d+).*", "\1", confint))

                      lower
                      [1] 0.741 263.917 12.788 0.680 0.650 0.719
                      upper
                      [1] 2.233 402.154 17.975 2.450 1.827 2.190





                      share|improve this answer



























                        11












                        11








                        11







                        A base R solution



                        lower = as.numeric(sub(".*?(\d+\.\d+).*", "\1", confint))
                        upper = as.numeric(sub(".*\b(\d+\.\d+).*", "\1", confint))

                        lower
                        [1] 0.741 263.917 12.788 0.680 0.650 0.719
                        upper
                        [1] 2.233 402.154 17.975 2.450 1.827 2.190





                        share|improve this answer















                        A base R solution



                        lower = as.numeric(sub(".*?(\d+\.\d+).*", "\1", confint))
                        upper = as.numeric(sub(".*\b(\d+\.\d+).*", "\1", confint))

                        lower
                        [1] 0.741 263.917 12.788 0.680 0.650 0.719
                        upper
                        [1] 2.233 402.154 17.975 2.450 1.827 2.190






                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited May 27 at 12:45

























                        answered May 27 at 12:41









                        G5WG5W

                        24.5k92345




                        24.5k92345























                            2














                            mypattern <- '\[(\d+\.\d+) ; (\d+\.\d+)\]'
                            as.numeric(gsub(mypattern, '\1', confint))
                            as.numeric(gsub(mypattern, '\2', confint))





                            share|improve this answer



























                              2














                              mypattern <- '\[(\d+\.\d+) ; (\d+\.\d+)\]'
                              as.numeric(gsub(mypattern, '\1', confint))
                              as.numeric(gsub(mypattern, '\2', confint))





                              share|improve this answer

























                                2












                                2








                                2







                                mypattern <- '\[(\d+\.\d+) ; (\d+\.\d+)\]'
                                as.numeric(gsub(mypattern, '\1', confint))
                                as.numeric(gsub(mypattern, '\2', confint))





                                share|improve this answer













                                mypattern <- '\[(\d+\.\d+) ; (\d+\.\d+)\]'
                                as.numeric(gsub(mypattern, '\1', confint))
                                as.numeric(gsub(mypattern, '\2', confint))






                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered May 27 at 12:52









                                pzhaopzhao

                                21018




                                21018





















                                    1














                                    A different base R possibility could be:



                                    sapply(strsplit(confint, " ; ", fixed = TRUE), function(x) gsub("[^0-9.-]+", "\1", x) [1])
                                    sapply(strsplit(confint, " ; ", fixed = TRUE), function(x) gsub("[^0-9.-]+", "\1", x) [2])

                                    [1] "0.741" "263.917" "12.788" "0.680" "0.650" "0.719"
                                    [1] "2.233" "402.154" "17.975" "2.450" "1.827" "2.190"


                                    If you need it as a numeric vector:



                                    sapply(strsplit(confint, " ; ", fixed = TRUE), function(x) as.numeric(gsub("[^0-9.-]+", "\1", x)) [1])
                                    sapply(strsplit(confint, " ; ", fixed = TRUE), function(x) as.numeric(gsub("[^0-9.-]+", "\1", x)) [2])





                                    share|improve this answer

























                                    • @Ronak Shah I updated my post according some of your ideas. Thank you :)

                                      – tmfmnk
                                      May 27 at 12:59











                                    • I realised it needed some more tweaking to get exact output but I think it was a similar approach. +1 to you.

                                      – Ronak Shah
                                      May 27 at 13:21















                                    1














                                    A different base R possibility could be:



                                    sapply(strsplit(confint, " ; ", fixed = TRUE), function(x) gsub("[^0-9.-]+", "\1", x) [1])
                                    sapply(strsplit(confint, " ; ", fixed = TRUE), function(x) gsub("[^0-9.-]+", "\1", x) [2])

                                    [1] "0.741" "263.917" "12.788" "0.680" "0.650" "0.719"
                                    [1] "2.233" "402.154" "17.975" "2.450" "1.827" "2.190"


                                    If you need it as a numeric vector:



                                    sapply(strsplit(confint, " ; ", fixed = TRUE), function(x) as.numeric(gsub("[^0-9.-]+", "\1", x)) [1])
                                    sapply(strsplit(confint, " ; ", fixed = TRUE), function(x) as.numeric(gsub("[^0-9.-]+", "\1", x)) [2])





                                    share|improve this answer

























                                    • @Ronak Shah I updated my post according some of your ideas. Thank you :)

                                      – tmfmnk
                                      May 27 at 12:59











                                    • I realised it needed some more tweaking to get exact output but I think it was a similar approach. +1 to you.

                                      – Ronak Shah
                                      May 27 at 13:21













                                    1












                                    1








                                    1







                                    A different base R possibility could be:



                                    sapply(strsplit(confint, " ; ", fixed = TRUE), function(x) gsub("[^0-9.-]+", "\1", x) [1])
                                    sapply(strsplit(confint, " ; ", fixed = TRUE), function(x) gsub("[^0-9.-]+", "\1", x) [2])

                                    [1] "0.741" "263.917" "12.788" "0.680" "0.650" "0.719"
                                    [1] "2.233" "402.154" "17.975" "2.450" "1.827" "2.190"


                                    If you need it as a numeric vector:



                                    sapply(strsplit(confint, " ; ", fixed = TRUE), function(x) as.numeric(gsub("[^0-9.-]+", "\1", x)) [1])
                                    sapply(strsplit(confint, " ; ", fixed = TRUE), function(x) as.numeric(gsub("[^0-9.-]+", "\1", x)) [2])





                                    share|improve this answer















                                    A different base R possibility could be:



                                    sapply(strsplit(confint, " ; ", fixed = TRUE), function(x) gsub("[^0-9.-]+", "\1", x) [1])
                                    sapply(strsplit(confint, " ; ", fixed = TRUE), function(x) gsub("[^0-9.-]+", "\1", x) [2])

                                    [1] "0.741" "263.917" "12.788" "0.680" "0.650" "0.719"
                                    [1] "2.233" "402.154" "17.975" "2.450" "1.827" "2.190"


                                    If you need it as a numeric vector:



                                    sapply(strsplit(confint, " ; ", fixed = TRUE), function(x) as.numeric(gsub("[^0-9.-]+", "\1", x)) [1])
                                    sapply(strsplit(confint, " ; ", fixed = TRUE), function(x) as.numeric(gsub("[^0-9.-]+", "\1", x)) [2])






                                    share|improve this answer














                                    share|improve this answer



                                    share|improve this answer








                                    edited May 27 at 12:58

























                                    answered May 27 at 12:49









                                    tmfmnktmfmnk

                                    6,3861821




                                    6,3861821












                                    • @Ronak Shah I updated my post according some of your ideas. Thank you :)

                                      – tmfmnk
                                      May 27 at 12:59











                                    • I realised it needed some more tweaking to get exact output but I think it was a similar approach. +1 to you.

                                      – Ronak Shah
                                      May 27 at 13:21

















                                    • @Ronak Shah I updated my post according some of your ideas. Thank you :)

                                      – tmfmnk
                                      May 27 at 12:59











                                    • I realised it needed some more tweaking to get exact output but I think it was a similar approach. +1 to you.

                                      – Ronak Shah
                                      May 27 at 13:21
















                                    @Ronak Shah I updated my post according some of your ideas. Thank you :)

                                    – tmfmnk
                                    May 27 at 12:59





                                    @Ronak Shah I updated my post according some of your ideas. Thank you :)

                                    – tmfmnk
                                    May 27 at 12:59













                                    I realised it needed some more tweaking to get exact output but I think it was a similar approach. +1 to you.

                                    – Ronak Shah
                                    May 27 at 13:21





                                    I realised it needed some more tweaking to get exact output but I think it was a similar approach. +1 to you.

                                    – Ronak Shah
                                    May 27 at 13:21











                                    1














                                    Meanwhile, I came up with another base R solution



                                    lower <- as.numeric(sub(".]*", "", sub(";.*", "", confint)))
                                    upper <- as.numeric(sub("].*", "", sub(".*;", "", confint)))

                                    lower
                                    [1] 0.741 263.917 12.788 0.680 0.650 0.719
                                    upper
                                    [1] 2.233 402.154 17.975 2.450 1.827 2.190


                                    Thank you all!






                                    share|improve this answer





























                                      1














                                      Meanwhile, I came up with another base R solution



                                      lower <- as.numeric(sub(".]*", "", sub(";.*", "", confint)))
                                      upper <- as.numeric(sub("].*", "", sub(".*;", "", confint)))

                                      lower
                                      [1] 0.741 263.917 12.788 0.680 0.650 0.719
                                      upper
                                      [1] 2.233 402.154 17.975 2.450 1.827 2.190


                                      Thank you all!






                                      share|improve this answer



























                                        1












                                        1








                                        1







                                        Meanwhile, I came up with another base R solution



                                        lower <- as.numeric(sub(".]*", "", sub(";.*", "", confint)))
                                        upper <- as.numeric(sub("].*", "", sub(".*;", "", confint)))

                                        lower
                                        [1] 0.741 263.917 12.788 0.680 0.650 0.719
                                        upper
                                        [1] 2.233 402.154 17.975 2.450 1.827 2.190


                                        Thank you all!






                                        share|improve this answer















                                        Meanwhile, I came up with another base R solution



                                        lower <- as.numeric(sub(".]*", "", sub(";.*", "", confint)))
                                        upper <- as.numeric(sub("].*", "", sub(".*;", "", confint)))

                                        lower
                                        [1] 0.741 263.917 12.788 0.680 0.650 0.719
                                        upper
                                        [1] 2.233 402.154 17.975 2.450 1.827 2.190


                                        Thank you all!







                                        share|improve this answer














                                        share|improve this answer



                                        share|improve this answer








                                        edited May 28 at 6:18

























                                        answered May 27 at 13:22









                                        FatetaFateta

                                        826




                                        826





















                                            0














                                            You can use functions from the stringr library.



                                            You can split strings with str_split() according a specific character (; in your case), then remove character with str_remove() ([ and ] in your case) and you will obtain what you want.



                                            str_remove(str_split_fixed(confint, ";", n = 2)[,1], '\[') %>% as.numeric()
                                            # [1] 0.741 263.917 12.788 0.680 0.650 0.719





                                            share|improve this answer





























                                              0














                                              You can use functions from the stringr library.



                                              You can split strings with str_split() according a specific character (; in your case), then remove character with str_remove() ([ and ] in your case) and you will obtain what you want.



                                              str_remove(str_split_fixed(confint, ";", n = 2)[,1], '\[') %>% as.numeric()
                                              # [1] 0.741 263.917 12.788 0.680 0.650 0.719





                                              share|improve this answer



























                                                0












                                                0








                                                0







                                                You can use functions from the stringr library.



                                                You can split strings with str_split() according a specific character (; in your case), then remove character with str_remove() ([ and ] in your case) and you will obtain what you want.



                                                str_remove(str_split_fixed(confint, ";", n = 2)[,1], '\[') %>% as.numeric()
                                                # [1] 0.741 263.917 12.788 0.680 0.650 0.719





                                                share|improve this answer















                                                You can use functions from the stringr library.



                                                You can split strings with str_split() according a specific character (; in your case), then remove character with str_remove() ([ and ] in your case) and you will obtain what you want.



                                                str_remove(str_split_fixed(confint, ";", n = 2)[,1], '\[') %>% as.numeric()
                                                # [1] 0.741 263.917 12.788 0.680 0.650 0.719






                                                share|improve this answer














                                                share|improve this answer



                                                share|improve this answer








                                                edited May 27 at 12:45

























                                                answered May 27 at 12:38









                                                demarsylvaindemarsylvain

                                                1,2722621




                                                1,2722621





















                                                    0














                                                    A tidyverse solution:



                                                    library(dplyr)
                                                    library(tidyr)

                                                    df = data.frame(confint)
                                                    df = df %>%
                                                    mutate(confint = gsub("(\[|\])","",confint)) %>%
                                                    separate(confint,c("lower","upper"),";",convert=T)





                                                    share|improve this answer



























                                                      0














                                                      A tidyverse solution:



                                                      library(dplyr)
                                                      library(tidyr)

                                                      df = data.frame(confint)
                                                      df = df %>%
                                                      mutate(confint = gsub("(\[|\])","",confint)) %>%
                                                      separate(confint,c("lower","upper"),";",convert=T)





                                                      share|improve this answer

























                                                        0












                                                        0








                                                        0







                                                        A tidyverse solution:



                                                        library(dplyr)
                                                        library(tidyr)

                                                        df = data.frame(confint)
                                                        df = df %>%
                                                        mutate(confint = gsub("(\[|\])","",confint)) %>%
                                                        separate(confint,c("lower","upper"),";",convert=T)





                                                        share|improve this answer













                                                        A tidyverse solution:



                                                        library(dplyr)
                                                        library(tidyr)

                                                        df = data.frame(confint)
                                                        df = df %>%
                                                        mutate(confint = gsub("(\[|\])","",confint)) %>%
                                                        separate(confint,c("lower","upper"),";",convert=T)






                                                        share|improve this answer












                                                        share|improve this answer



                                                        share|improve this answer










                                                        answered May 27 at 14:12









                                                        FinoFino

                                                        816316




                                                        816316




















                                                            Fateta is a new contributor. Be nice, and check out our Code of Conduct.









                                                            draft saved

                                                            draft discarded


















                                                            Fateta is a new contributor. Be nice, and check out our Code of Conduct.












                                                            Fateta is a new contributor. Be nice, and check out our Code of Conduct.











                                                            Fateta is a new contributor. Be nice, and check out our Code of Conduct.














                                                            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%2f56326130%2fhow-to-extract-lower-and-upper-bound-in-numeric-format-from-a-confidence-interva%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

                                                            Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

                                                            Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                                                            Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form