R/utils-constit.R

Defines functions cons_tidy

## Tidy function for constituency calls

cons_tidy <- function(df, current, tidy_style) {
  if (nrow(df) > 0) {
    if (is.null(current) || current == FALSE) {
      df$endedDate._value <- as.POSIXct(df$endedDate._value)

      df$endedDate._datatype <- "POSIXct"
    }

    df$startedDate._value <- as.POSIXct(df$startedDate._value)

    df$startedDate._datatype <- "POSIXct"

    df <- hansard_tidy(df, tidy_style)
  }

  df
}

Try the hansard package in your browser

Any scripts or data that you put into this service are public.

hansard documentation built on Nov. 13, 2019, 5:06 p.m.