Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. structure(list(condition = c("id_0.2cov_0.0evalue_0.001", "id_0.3cov_0.0evalue_0.001",
  2. "id_0.4cov_0.0evalue_0.001", "id_0.5cov_0.0evalue_0.001", "id_0.6cov_0.0evalue_0.001",
  3. "id_0.7cov_0.0evalue_0.001", "id_0.8cov_0.0evalue_0.001", "id_0.9cov_0.0evalue_0.001",
  4. "id_1.0cov_0.0evalue_0.001"), min = c(1, 1, 1, 1, 1, 1, 1, 1,
  5. 1), max = c(14342, 11393, 2084, 605, 599, 332, 312, 87, 27),
  6. mean = c(140.048780487805, 54.4480442512841, 13.275661095323,
  7. 3.88437742230991, 3.06546546546547, 2.34792609062332, 1.80316779085515,
  8. 1.38615434908341, 1.0040692315819), sd = c(678.649173146197,
  9. 264.996993952984, 48.1297686832552, 10.8809910787991, 7.88905730023133,
  10. 5.24114778761008, 3.328441395118, 1.64173750197931, 0.0878496418628203
  11. ), sum = c(275616L, 275616L, 275616L, 275616L, 275616L, 275616L,
  12. 275616L, 275616L, 275616L), n = c(1968L, 5062L, 20761L, 70955L,
  13. 89910L, 117387L, 152851L, 198835L, 274499L), rep = c(0.00714036920933473,
  14. 0.0183661325902705, 0.0753258156275398, 0.257441512829444,
  15. 0.32621473354232, 0.425907784743992, 0.554579559967491, 0.721420381980727,
  16. 0.995947259955881), dif = c(273648L, 270554L, 254855L, 204661L,
  17. 185706L, 158229L, 122765L, 76781L, 1117L), identity = c(0.2,
  18. 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1)), class = c("tbl_df",
  19. "tbl", "data.frame"), row.names = c(NA, -9L))
  20.  
  21. library(shiny)
  22. library(ggplot2)
  23.  
  24. ui <- shinyUI(
  25. fluidPage(
  26. titlePanel("Cluster summary"),
  27. sidebarLayout(
  28. sidebarPanel(
  29. selectInput(
  30. "selectedX",
  31. "Select colum for X axis",
  32. choices = colnames(clu.summary[-1]),
  33. selected = colnames(clu.summary[-1])[2]
  34. ),
  35. selectInput(
  36. "selectedY",
  37. "Select colum for Y axis",
  38. choices = colnames(clu.summary[-1]),
  39. selected = colnames(clu.summary[-1])[3]
  40. ),
  41. selectInput(
  42. "selectedG",
  43. "Select colum for Group",
  44. choices = colnames(clu.summary[,c(1,10)]),
  45. selected = colnames(clu.summary[,c(1,10)])[2]
  46. )
  47. ),
  48. mainPanel(plotOutput("distPlot")) )))
  49.  
  50. server <- shinyServer(function(input, output) {
  51. output$distPlot <- renderPlot({
  52. x_axis <- input$selectedX
  53. y_axis <- input$selectedY
  54. gcolor <- input$selectedG
  55. gg <- ggplot(clu.summary, aes(x=x_axis,y=y_axis)) +
  56. geom_point(aes(color=gcolor)) +
  57. geom_smooth(method = "lm")
  58. gg
  59. })
  60. })
  61.  
  62. shinyApp(ui, server)
  63.  
  64. > colnames(clu.summary[-1])[2]
  65. [1] "max"
  66. > colnames(clu.summary[-1])[3]
  67. [1] "mean"
  68. > colnames(clu.summary[,c(1,10)])[2]
  69. [1] "identity"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement