R/get_workbook_id.R

Defines functions get_workbook_id

Documented in get_workbook_id

#' Get workbook ID name.
#'
#' @param wb The path to the Tableau workbook [.twb].
#'
#' @return The ID name of the workbook.
#' @export
#'
#' @family xml
get_workbook_id <- function(wb) {
  proc <- make_rootnodes(wb)

  nodenames <- get_nodenames(proc)

  xy <- which(nodenames == "repository-location")

  ID <- cbind(XML::xpathSApply(proc[[xy]], ".", XML::xmlGetAttr, "id"))
  return(as.character(ID))
}

Try the vvtableau package in your browser

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

vvtableau documentation built on Sept. 11, 2024, 6:51 p.m.