Commit 5f0c2aad authored by Midoux Cedric's avatar Midoux Cedric

acpScript

parent 8ed00454
......@@ -1215,8 +1215,52 @@ shinyServer
"acpRep",
label = "Barycenters : ",
choices = c("..." = 0, sample_variables(data16S()))
)
),
collapsedBox(verbatimTextOutput("acpScript"), title = "RCode")
)
})
output$acpScript <- renderText({
scriptArgs <- c(
"physeq = data",
glue(
"ordination = ordinate(data, method = \"{input$acpMethod}\", distance = \"{input$acpDist}\")"
),
glue("axes = c({glue_collapse(input$acpAxes, sep = ', ')})")
)
if (!is.null(checkNull(input$acpCol))) {
scriptArgs <- c(scriptArgs, glue("color = \"{input$acpCol}\""))
}
if (!is.null(checkNull(input$acpShape))) {
scriptArgs <- c(scriptArgs, glue("shape = \"{input$acpShape}\""))
}
if (!is.null(checkNull(input$acpRep))) {
scriptArgs <- c(scriptArgs, glue("replicate = \"{input$acpRep}\""))
} else {
scriptArgs <- c(scriptArgs, glue("replicate = NULL"))
}
if (!is.null(checkNull(input$acpLabel))) {
scriptArgs <- c(scriptArgs, glue("label = \"{input$acpLabel}\""))
}
if (!is.null(checkNull(input$acpTitle))) {
scriptArgs <- c(scriptArgs, glue("title = \"{input$acpTitle}\""))
}
script <- c(
scriptHead,
"# MultiDimensional scaling",
glue("p <- plot_samples({glue_collapse(scriptArgs, sep=', ')})")
)
if (!is.null(checkNull(input$acpEllipse))) {
script <- c(
script,
glue(
"p <- p + stat_ellipse(aes_string(group = \"{input$acpEllipse}\"))"
)
)
}
script <- c(script, "", "plot(p + theme_bw())")
return(glue_collapse(script, sep = "\n"))
})
output$acp <- renderPlot({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment