I am trying to style ELISA data (numeric) table as described here and I get the following error for the code
brks <- quantile(df, probs = seq(.05, .95, .05), na.rm = TRUE)
I used the following code as described in the web page. Can someone please point out to me what am I missing here?
df <- matrix(nrow=8, ncol=12)
for (i in 1:8) {
for (j in 1:12)
df[i,j] <- format(as.numeric(elisa65[i,j])/as.numeric(elisa74[i,j]),digits = 4)
}
brks <- quantile(df, probs = seq(.05, .95, .05), na.rm = TRUE)
clrs <- round(seq(255, 40, length.out = length(brks) + 1), 0)
%>% {paste0("rgb(255,", ., ",", ., ")")}
DT::datatable(df) %>% formatStyle(names(df), backgroundColor = styleInterval(brks, clrs))