Skip to content

Commit 01cbfd3

Browse files
committed
merged folders
1 parent 5e9fafc commit 01cbfd3

File tree

5 files changed

+140
-0
lines changed

5 files changed

+140
-0
lines changed

mesocosm/prc/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.Rproj.user
2+
.Rhistory
3+
.RData

mesocosm/prc/prc.Rproj

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Version: 1.0
2+
3+
RestoreWorkspace: Default
4+
SaveWorkspace: Default
5+
AlwaysSaveHistory: Default
6+
7+
EnableCodeIndexing: Yes
8+
UseSpacesForTab: Yes
9+
NumSpacesForTab: 2
10+
Encoding: UTF-8
11+
12+
RnwWeave: knitr
13+
LaTeX: pdfLaTeX
14+
15+
AutoAppendNewline: Yes

mesocosm/prc/server.R

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
library(shiny)
2+
library(vegan)
3+
data(pyrifos)
4+
time <- gl(11, 12, labels=c(-4, -1, 0.1, 1, 2, 4, 8, 12, 15, 19, 24))
5+
treatment <- factor(rep(c(0.1, 0, 0, 0.9, 0, 44, 6, 0.1, 44, 0.9, 0, 6), 11))
6+
replicate <- gl(12, 1, length=132)
7+
envdata <- data.frame(replicate, treatment, time)
8+
9+
10+
shinyServer(function(input, output){
11+
abu <- reactive({
12+
abufile <- input$abufile
13+
if (input$example == TRUE & is.null(abufile)) {
14+
pyrifos
15+
} else {
16+
if (input$example == FALSE & !is.null(abufile)) {
17+
read.csv(
18+
file = abufile$datapath,
19+
header = input$header,
20+
sep = input$sep,
21+
quote = input$quote
22+
)
23+
}
24+
}
25+
})
26+
27+
env <- reactive({
28+
envfile <- input$envfile
29+
if (input$example == TRUE & is.null(envfile)) {
30+
envdata
31+
} else {
32+
if (input$example == FALSE & !is.null(envfile)) {
33+
read.csv(
34+
file = envfile$datapath,
35+
header = input$header,
36+
sep = input$sep,
37+
quote = input$quote
38+
)
39+
}
40+
}
41+
})
42+
43+
44+
output$abutable <- renderTable({
45+
abu()[1:10 , 1:10]
46+
})
47+
48+
output$envtable <- renderTable({
49+
env()[1:10, ]
50+
})
51+
})

mesocosm/prc/ui.R

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#runApp('C:\\Users\\pbuttigi\\Documents\\Revolution\\EATME\\RDA', launch.browser = FALSE)
2+
3+
library(shiny)
4+
library(markdown)
5+
6+
shinyUI(
7+
navbarPage("PRC",
8+
tabPanel('Data'),
9+
sidebarLayout(
10+
sidebarPanel(
11+
tabsetPanel(
12+
tabPanel("Example data",
13+
h4("Use example data"),
14+
p("Tick the box below if you'd like to use the chlorpyrifos' dataset:"),
15+
checkboxInput('example', 'Use Chlorpyrifos dataset', FALSE),
16+
h4("Download example data"),
17+
p("Alternatively, you can download both data files here and upload them in the next tab.")
18+
),
19+
tabPanel("Data Upload",
20+
h3("Upload data in csv format"),
21+
h4("CSV settings:"),
22+
h5(strong("Header")),
23+
checkboxInput('header', 'first row contains column names', TRUE),
24+
radioButtons(
25+
inputId = 'sep',
26+
label = 'Separator',
27+
choices = c(
28+
Comma = ',',
29+
Semicolon = ';',
30+
Tab = '\t'
31+
)
32+
),
33+
radioButtons(
34+
inputId = 'quote',
35+
label = 'Quotes',
36+
choices = c(
37+
'Double quotes' = '"',
38+
'Single quotes' = "'",
39+
'None' = ''
40+
)
41+
),
42+
h5(strong("Abundance data")),
43+
fileInput(
44+
inputId = 'abufile',
45+
label = 'Select a CSV file with samples as rows and species as columns.',
46+
accept = c('text/csv','text/comma-separated-values','.csv')
47+
),
48+
h5(strong("Explanatory data")),
49+
fileInput(
50+
'envfile',
51+
'Select a CSV file with three columns: time, treatment and replicat. ',
52+
accept = c('text/csv','text/comma-separated-values','.csv')
53+
)
54+
)
55+
)
56+
),
57+
mainPanel(
58+
h3("Abundance data"),
59+
p("Displaying first 10 species, and rows"),
60+
tableOutput("abutable"),
61+
h3("Env data"),
62+
p("Displaying first 10 rows"),
63+
tableOutput("envtable")
64+
),
65+
),
66+
tabPanel('Transformations'),
67+
tabPanel('Plot'),
68+
tabPanel('Summary'),
69+
tabPanel('Population level statistics')
70+
))

power_ecotox

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit b262ed268700ec29f4e5fbdfd5d10227772d131f

0 commit comments

Comments
 (0)