交叉表突出显示变量组合

时间:2017-10-17 11:14:17

标签: r

我想创建一个包含比例表的数据框,在这个表中我想强调两个变量的某些组合。我想用黄色突出显示值为:

的单元格
  

蓝色和低蓝   高和绿   红色和高

当前代码:

df <- data.frame(op=c("high","medium","low","high","high","medium","low","high","medium"),fr=c("blue","red","green","green","red","blue","red","green","red"))
mytable <- table(df$op,df$fr)
df2 <- prop.table(mytable)

0 个答案:

没有答案