R/to_one_table.R

#' Joins context and units on fact table
#' @param xbrl object produced by xbrl()
#' @export
#' @importFrom magrittr "%>%"
to_one_table <- function(xbrl){
  table <- xbrl$fact %>%
    dplyr::left_join(xbrl$units, by = c("unit_ref" =  "id")) %>%
    dplyr::left_join(xbrl$contexts, by = c("context_ref" = "id"))
}
soetang/xbrlr documentation built on May 26, 2019, 7:01 p.m.