-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.R
62 lines (52 loc) · 1.65 KB
/
app.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#
# This is a Shiny web application. You can run the application by clicking
# the 'Run App' button above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(shiny)
rsstats <- read.csv('RefSeq_Stats.tsv', header = TRUE, sep = '\t')
rownames(rsstats) <- rsstats[,1] # set rownames to release number
rsstats <- rsstats[order(as.numeric(row.names(rsstats))), ] # sort dataframe by release number as a number
rsstats <- rsstats[-1] # remove release number column from the table
ui <- fluidPage(
titlePanel("RefSeq release species counts"),
# sidebarLayout(
sidebarPanel(
selectInput("taxgroup", "Taxonomic Group:",
choices=colnames(rsstats)),
hr(),
helpText("RefSeq species broad taxonomic groups")
),
mainPanel(
plotOutput("taxbarplot")
),
# ),
sidebarPanel(
# selectInput('xcol', 'X Variable', choices = rownames(rsstats)),
selectInput('ycol', 'Y Variable', choices = colnames(rsstats), multiple = FALSE, selected = 'vertebrate_mammalian')
),
mainPanel(
plotOutput('taxxyplot')
)
)
server <- function(input, output) {
output$taxbarplot <- renderPlot({
barplot(rsstats[,input$taxgroup],
names.arg = rownames(rsstats),
col = "#75AADB",
border = "white",
main=input$taxgroup,
ylab="Number of species",
xlab="RefSeq release")
})
output$taxxyplot <- renderPlot({
plot(rownames(rsstats), rsstats[,input$ycol],
main=input$taxgroup,
ylab="Number of species",
xlab="RefSeq release")
})
}
shinyApp(ui = ui, server = server)