Skip to content

Commit

Permalink
chore: simplify the numeric to factor conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
vedhav committed Oct 16, 2023
1 parent 67c7ca8 commit 3c426ba
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions R/tm_variable_browser.R
Original file line number Diff line number Diff line change
Expand Up @@ -500,13 +500,11 @@ srv_variable_browser <- function(id,

### REPORTER
if (with_reporter) {
card_fun <- function(comment, label) {
card <- teal::report_card_template(
title = "Variable Browser Plot",
label = label,
with_filter = with_filter,
filter_panel_api = filter_panel_api
)
card_fun <- function(comment) {
card <- teal::TealReportCard$new()
card$set_name("Variable Browser Plot")
card$append_text("Variable Browser Plot", "header2")
if (with_filter) card$append_fs(filter_panel_api$get_filter_state())
card$append_text("Plot", "header3")
card$append_plot(variable_plot_r(), dim = pws$dim())
if (!comment == "") {
Expand Down Expand Up @@ -939,7 +937,7 @@ plot_var_summary <- function(var,
validate(need(!any(is.infinite(var)), "Cannot display graph when data includes infinite values"))

if (numeric_as_factor) {
var <- factor(var, levels = sort(unique(var)))
var <- factor(var)
ggplot(NULL, aes(x = var)) +
geom_histogram(stat = "count")
} else {
Expand Down

0 comments on commit 3c426ba

Please sign in to comment.