kableExtra icon indicating copy to clipboard operation
kableExtra copied to clipboard

spec_pointrange not working when using one row only

Open SBata opened this issue 2 years ago • 0 comments

I have a single row data frame and I can't seem to be able to add a pointrange image in the specified column. any suggestions why that doesn't work?

see code below.

test <- data.frame(A = 0.9,
                   B = 0.1,
                   C = 2.3,
                   D = 8,
                   FF = 32,
                   E = 0.3,
                   H = 1.2)

test %>%
  kbl(booktabs = T,
      escape = F,
      align = 'r') %>%
  kable_classic_2(full_width = F, 
                  font_size= 12) %>% 
  column_spec(1:6, width = '3cm') %>%
  column_spec(column = 7, 
              width = '4cm',
              image =  spec_pointrange(
                #use original dataframes data to create forest plot
                x = 1.2,
                xmin = 0.2,
                xmax = 1.5,
                cex = 0.75,
                col = 'red', 
                lim = c(0,2),
                width = 600,
                height = 40,
                vline = 1)

This will create the table, but the pointrange image is not printed....

SBata avatar Dec 01 '22 06:12 SBata