diff --git a/R/interactive_table1.R b/R/interactive_table1.R index 0512f59..2985903 100644 --- a/R/interactive_table1.R +++ b/R/interactive_table1.R @@ -6,6 +6,7 @@ interactive_table1 <- function(meta, keep_missing = TRUE, total = TRUE, column_header = TRUE, + show_listing = TRUE, var_listing = NULL, download = "none", type = NULL, @@ -31,6 +32,7 @@ interactive_table1 <- function(meta, if (!listing) { message("Drill-down listing is not provided because there are more than ", max_row, " rows in the datasets") } + listing <- show_listing & listing tbl <- metalite::collect_n_subject(meta, population = population, diff --git a/R/metalite_table1.R b/R/metalite_table1.R index 836bf5b..60935a2 100644 --- a/R/metalite_table1.R +++ b/R/metalite_table1.R @@ -23,7 +23,7 @@ #' @export metalite_table1 <- function(formula, data, - id, + id = NULL, var_listing = NULL, total = TRUE, header = NULL, @@ -34,6 +34,14 @@ metalite_table1 <- function(formula, stop("There is no records in the input dataset") } + if(is.null(id)){ + data$.id <- 1:nrow(data) + id = ".id" + show_listing <- FALSE + }else{ + show_listing <- TRUE + } + if (formula[[2]][[1]] == "|") { var <- all.vars(formula[[2]][[2]]) group <- all.vars(formula[[2]][[3]]) @@ -112,6 +120,7 @@ metalite_table1 <- function(formula, htmltools::browsable( htmltools::tagList(metalite::meta_run( meta, + show_listing = show_listing, var_listing = var_listing, download = download, type = record_name