在formattable程序包产生的表的某一列中产生颜色的问题

我早些时候应用了此代码,由于matching_probability部分未显示色块,因此结果未完全达到预期。 我无法添加图像,否则我会显示。

formattable(df,align = c("l","c","r"),list(`Locus_number` = formatter(
                "span",style = ~ style(color = "grey",font.weight = "bold")),`PIC`= color_tile(customGreen,customGreen0),`Matchin_Probability`= color_tile('white','orange'),`Power_of_Discrimination`= color_tile(customGreen,`Power_of_Exclusion`= color_tile(customGreen,`Paternity_Index` = color_bar(customRed)
            ))
iCMS 回答:在formattable程序包产生的表的某一列中产生颜色的问题

我过去也遇到过同样的问题,可能您在特定列中有一些inf值,只需将其替换为0或NA

df[mapply(is.infinite,df)] <- NA
本文链接:https://www.f2er.com/2064455.html

大家都在问