Skip to content

Bug in table_id_inject multiple matches #4

@lebebr01

Description

@lebebr01

Erroneously did not test use cases when more than one match is returned.

This works:

library(dplyr)
library(highlightHTML)

chick_tab <- chickwts %>%
  group_by(feed) %>%
  summarise(avg_weight = mean(weight),
            sd_weight = sd(weight))

table_id_inject(chick_tab, id = c('#bggrey', '#bgblack'), 
                conditions = c('> 325', '< 165'),
                variable = list('avg_weight', 'avg_weight'))

This does not:

library(dplyr)
library(highlightHTML)

chick_tab <- chickwts %>%
  group_by(feed) %>%
  summarise(avg_weight = mean(weight),
            sd_weight = sd(weight))

table_id_inject(chick_tab, id = c('#bggrey', '#bgblack'), 
                conditions = c('> 270', '> 300'),
                variable = list('avg_weight', 'avg_weight'))

The issues is multiple conditional matches to the conditions argument.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions