Skip to content

Instantly share code, notes, and snippets.

@markdly
Created March 15, 2018 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markdly/faad0500b88568bb091e4b72bd75fc6f to your computer and use it in GitHub Desktop.
Save markdly/faad0500b88568bb091e4b72bd75fc6f to your computer and use it in GitHub Desktop.

From Ben Fitzpatrick. Gist adapted from Nicholas Tierney's

library(tidyverse)
ci <- c('11% - 20%', '21% - 30%', '0% - 9%')
ci %>% 
  as_tibble() %>% 
  extract(value, c("Lw", "Up"), "([0-9]+)% - ([0-9]+)%", convert = TRUE)
#> # A tibble: 3 x 2
#>      Lw    Up
#>   <int> <int>
#> 1    11    20
#> 2    21    30
#> 3     0     9

Created on 2018-03-16 by the reprex package (v0.2.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment