Skip to content

Instantly share code, notes, and snippets.

@cgpu
Created November 14, 2018 12:43
Show Gist options
  • Select an option

  • Save cgpu/7755c18e38e3f014a53cf917123a9532 to your computer and use it in GitHub Desktop.

Select an option

Save cgpu/7755c18e38e3f014a53cf917123a9532 to your computer and use it in GitHub Desktop.
Extract numbers from string. One-liner courtesy of @stla GitHub
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