get_nonmobiles: Parse a vector of User Agent strings to distinguish mobiles...

Description Usage Arguments Value Author(s) Examples

View source: R/get_nonmobiles.R

Description

Parse a vector of User Agent strings and return a binary vector identifying mobiles (1 = non-mobile, 0 = mobile).

Usage

1
get_nonmobiles(ua_strings)

Arguments

ua_strings

A vector of User Agent strings. Note that missing values cannot be parsed and a vector with NA elements will generate an error.

Value

Binary vector the same length as ua_strings (default).

Author(s)

Kyle Peyton <kyle.peyton@yale.edu>

Examples

1
2
3
4
5
6
7
data(agents)

## Extract binary vector (1 = non-mobile, 0 = mobile)
nonmobiles <- get_nonmobiles(ua_strings = agents)

## proportion of "attentive" respondents (those not coming from mobile phones)
mean(nonmobiles)

kylepeyton/attentive documentation built on Jan. 1, 2021, 8:16 a.m.