I have a df as following:
Apr 2017 May 2017 Jun 2017 Jul 2017 Aug 2017 Sep 2017
zz 0.1937571 0.1840005 0.1807256 0.1959589 0.2039463 0.2016886
aa 0.3518203 0.3634578 0.3670747 0.3676495 0.3680581 0.3657724
bb 0.10651308 0.11548379 0.11572389 0.11272168 0.11361587 0.11503638
cc 0.2481513 0.2579199 0.2623222 0.2673914 0.2579430 0.2550686
dd 0.06641069 0.06741159 0.07305105 0.07373854 0.07043972 0.07304338
I am trying to style the full table based on values(similar to this,[eg3].
Below is the code I have :
brks <- reactive({ quantile(intrc_pattern(), probs = seq(0, 1, 0.25), na.rm = TRUE)})
clrs <- reactive({ round(seq(255, 40, length.out = length(brks()) + 1), 0) %>%
{paste0("rgb(255,", ., ",", ., ")")}})
intrc_pattern_reshape<- reactive ({datatable(intrc_pattern_re(),options = list(searching = FALSE,pageLength = 15, lengthChange = FALSE))%>%
formatPercentage(colnames(intrc_pattern_re()), 2) %>%
formatStyle(names(intrc_pattern_re()),backgroundColor = styleInterval(brks(), clrs()))
})
But when I do that I get the following error : non-numeric argument to binary operator
Could someone tell me what is that I am doing incorrectly? Thank you.