ua_parse: Parse a vector of user agents into a data frame

Description Usage Arguments Value Note References Examples

View source: R/uaparser.R

Description

Takes in a character vector of user agent strings and returns a data frame classed as tibble. of parsed user agents.

Usage

1
2
3
ua_parse(user_agents, .progress = FALSE)

get_cache()

Arguments

user_agents

a character vector of user agents

.progress

if 'TRUE' will display a progress bar in interactive mode

Value

a data frame classed as tibble with columns for user agent family, major & minor versions plus patch level along with OS family and major & minor versions plus device brand and model.

Note

The regex YAML import date: 2020-03-31

References

<http://www.uaparser.org/>

Examples

1
2
3
ua_parse(paste0("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.2 (KHTML, ",
                "like Gecko) Ubuntu/11.10 Chromium/15.0.874.106 ",
                "Chrome/15.0.874.106 Safari/535.2", collapse=""))

Example output

# A tibble: 1 x 9
                                                                         userAgent
                                                                             <chr>
1 Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.2 (KHTML, like Gecko) Ubuntu/11.
# ... with 8 more variables: ua.family <chr>, ua.major <chr>, ua.minor <chr>,
#   ua.patch <chr>, os.family <chr>, os.major <chr>, os.minor <chr>,
#   device.family <chr>

uaparserjs documentation built on July 1, 2020, 5:38 p.m.