Skip to content

Commit

Permalink
bivariate fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolas Burkoff committed Jan 6, 2023
1 parent 292d2cb commit dd4a596
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/tm_g_bivariate.R
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ srv_g_bivariate <- function(id,
}
rule_diff <- function(other) {
function(value) {
if (!is.null(input[[other]])) {
if (other %in% names(selector_list()) && !is.null(selector_list()[[other]]()$select)) {

This comment has been minimized.

Copy link
@chlebowa

chlebowa Jan 9, 2023

Contributor

This comes up in bivariate, outliers, scatterplot, and response.
Isn't other %in% names(selector_list()) redundant in these cases? Indexing selector_list() with a non-existent name returns NULL. I tested all modules without this clause and double checked bivariate just now, seems to work fine.

This comment has been minimized.

Copy link
@gogonzo

gogonzo Jan 9, 2023

Contributor

Method $ doesn't exist for NULL, but [[ is possible. We can change to selector_list[[other]][["select"]] and remove the first part of the condition

This comment has been minimized.

Copy link
@chlebowa

chlebowa Jan 9, 2023

Contributor

Ok, that's what I will do.

othervalue <- selector_list()[[other]]()$select
if (identical(value, othervalue))
"Row and column facetting variables must be different."
Expand Down

0 comments on commit dd4a596

Please sign in to comment.