Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Cedric Midoux
Easy16S
Commits
a7db4a9a
Commit
a7db4a9a
authored
Jan 06, 2021
by
Cedric Midoux
Browse files
MANOVA interactions
parent
58726f00
Changes
1
Hide whitespace changes
Inline
Side-by-side
panels/richnessB-server.R
View file @
a7db4a9a
...
...
@@ -151,22 +151,50 @@ output$betaManovaUI <- renderUI({
title
=
"Setting : "
,
width
=
NULL
,
status
=
"primary"
,
selectInput
(
"betaManovaVar"
,
label
=
"Covariates"
,
multiple
=
TRUE
,
choices
=
c
(
sample_variables
(
physeq
())),
selected
=
NULL
)
#,
selectizeInput
(
"betaManovaVar"
,
label
=
"Covariates (ordered list ; max=3) :"
,
multiple
=
TRUE
,
choices
=
c
(
sample_variables
(
physeq
())),
selected
=
NULL
,
options
=
list
(
maxItems
=
3
)
),
checkboxGroupInput
(
"betaManovaInteraction"
,
label
=
"Add interaction :"
,
choices
=
NULL
,
inline
=
TRUE
)
#,
# actionButton("betaManovaButton",
# "Compute"),
)
})
observe
({
if
(
is.null
(
input
$
betaManovaVar
))
{
interactions
<-
NULL
}
else
{
interactions
<-
list
(
NULL
,
paste
(
input
$
betaManovaVar
,
collapse
=
":"
),
c
(
paste
(
input
$
betaManovaVar
[
c
(
1
,
2
)],
collapse
=
":"
),
paste
(
input
$
betaManovaVar
[
c
(
1
,
3
)],
collapse
=
":"
),
paste
(
input
$
betaManovaVar
[
c
(
2
,
3
)],
collapse
=
":"
),
paste
(
input
$
betaManovaVar
,
collapse
=
":"
))
)[[
length
(
input
$
betaManovaVar
)]]
}
updateCheckboxGroupInput
(
session
,
inputId
=
"betaManovaInteraction"
,
choices
=
interactions
,
inline
=
TRUE
)
})
formula
<-
reactive
({
as.formula
(
paste
(
"betaDist()"
,
"~"
,
paste
(
c
(
input
$
betaManovaVar
,
input
$
betaManovaInteraction
),
collapse
=
"+"
)))})
output
$
betaManova
<-
renderPrint
({
validate
(
need
(
physeq
(),
"Requires an abundance dataset"
))
validate
(
need
(
input
$
betaManovaVar
,
"Requires at least one covariate"
))
vegan
::
adonis
(
as.
formula
(
paste
(
"betaDist()"
,
"~"
,
paste
(
input
$
betaManovaVar
,
collapse
=
"*"
))
),
formula
=
formula
(
),
data
=
as
(
sample_data
(
physeq
()),
"data.frame"
),
perm
=
9999
)
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment