R/get_nonmobiles.R

Defines functions get_nonmobiles

Documented in get_nonmobiles

get_nonmobiles <- function(ua_strings) {
  if (any(is.na(ua_strings))) {
    stop("Missing values in input vector cannot be parsed.")
  }

  flag <-
    grepl(
      "up.browser|up.link|mmp|smartphone|midp|wap|phone|iemobile|mobile|oneplus",
      ua_strings,
      ignore.case = TRUE
    )
  return(1 - flag)

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