Skip to content

Instantly share code, notes, and snippets.

@tmasjc
Last active August 13, 2020 10:11
Show Gist options
  • Save tmasjc/ca5e642264147fbea2b96c58818ff165 to your computer and use it in GitHub Desktop.
Save tmasjc/ca5e642264147fbea2b96c58818ff165 to your computer and use it in GitHub Desktop.
parallel extract info from user-agent string
library(feather)
library(dplyr)
library(purrr)
library(furrr)
library(uaparserjs)
raw <- feather::read_feather("raw.feather") %>%
`[[`('ua') %>%
purrr::discard(is.na) %>%
unique()
future::plan(strategy = "multiprocess")
print(Sys.time())
res = furrr::future_map(raw, ua_parse) %>% bind_rows()
print(Sys.time())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment