R/votacao.R

Defines functions votacao

Documented in votacao

#' Cria vetor informando se o voto por por unanimidade ou por maioria
#'
#' @param x  Vetor de dispositivos
#'
#' @return Vetor
#' @export
#'
votacao <- function(x = NULL) {


    dplyr::case_when(
      stringr::str_detect(x, "(?i)(v\\.\\s?u\\.?|un.ni)") ~ "unânime",
      stringr::str_detect(x, "(?i)v\\.?\\s?u\\.?\\)?\\.?$") ~ "unânime",
      stringr::str_detect(x, "(?i)maioria") ~ "maioria",
      TRUE ~ NA_character_
    )
}
renanperlati/TJSP documentation built on Dec. 22, 2021, 2:59 p.m.