首页 > 解决方案 > Frequency table base R vs renderTable Shiny

问题描述

When I run the following code in R, I get the table below.

df<-data.frame(color=rep(c("red", "blue", "green"), 10), numbers=c(1:5, 2:6, 3:7, 4:8, 5:9, 6:10))
table(df)

enter image description here

When I run the code in Shiny, using renderTable, I get what's below. I would prefer having a table set up like the one above because this one takes up a lot of space and is more difficult to read through. Especially since I actually have 30 "numbers" and 7 "colors", which would be 210 unique pairs instead of 30. How can I get the set up of the above table to output in Shiny?

enter image description here

标签: rshiny

解决方案


推荐阅读