Created
November 14, 2018 12:43
-
-
Save cgpu/7755c18e38e3f014a53cf917123a9532 to your computer and use it in GitHub Desktop.
Extract numbers from string. One-liner courtesy of @stla GitHub
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
| Numextract <- function(string){ unlist(regmatches(string,gregexpr("[[:digit:]]+\\.*[[:digit:]]*",string)))} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment