Created
          May 25, 2017 01:03 
        
      - 
      
 - 
        
Save jjesusfilho/1972df11b77e86c1242905a7e580e5b1 to your computer and use it in GitHub Desktop.  
    Extract query parameters from url
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | library(stringr) | |
| library(magritr) | |
| query_extract<-function(string){ | |
| s<-str_split(string,"&") %>% | |
| unlist() | |
| nomes<-s %>% | |
| str_extract(".*?(?=\\=)") | |
| valores<-s %>% | |
| str_extract("(?<=\\=).*") %>% | |
| as.list() %>% | |
| `names<-`(nomes) | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment