Skip to content

Commit

Permalink
Add render_register output_type default
Browse files Browse the repository at this point in the history
  • Loading branch information
angelina-momin committed Sep 13, 2024
1 parent f0018ef commit e9a8f34
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions R/utils_render_register_general.r
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,13 @@ generate_table_details <- function(table_key, table, filter, is_reg_table = TRUE
#' @param register_table The register table that needs to be rendered into different files.
#' @param table_details A list of details related to the table (e.g., output directory, metadata).
#' @param filter A string specifying the filter applied to the register data.
#' @param output_type A string specifying the desired output format ("md" for Markdown, "html" for HTML, "json" for JSON).
#' @param output_type Defaults to "other". A string specifying the desired output format "json" for JSON,
#' "csv" for CSVs and "other" for all other output types.
#'
#' @return None. The function generates a file in the specified format.
render_register <- function(register_table, table_details, filter, output_type){
# Filtering the columns of the table
file_type <- switch(output_type,
"json" = "json",
"other"
)
register_table <- filter_and_drop_register_columns(register_table, filter, file_type)
render_register <- function(register_table, table_details, filter, output_type="other"){

register_table <- filter_and_drop_register_columns(register_table, filter, output_type)

switch(output_type,
"md" = render_register_md(register_table, table_details, filter),
Expand Down

0 comments on commit e9a8f34

Please sign in to comment.