-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finish the use_template_app function that builds a shiny app skeleton
- Loading branch information
Showing
5 changed files
with
102 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,37 @@ | ||
function(input, output, session) { | ||
|
||
# The dataset the user chooses from the data import module | ||
main_data <- dataimport$server() | ||
|
||
output$session_info <- renderPrint({ | ||
sessionInfo() | ||
}) | ||
|
||
# Dynamically generate the module for remapping variables | ||
mapcolumns_module <- reactive({ | ||
data <- main_data() | ||
shinyHelpers::mapcolumnsModule( | ||
id = "mapcolumns", | ||
data = data, | ||
names = c("dob", "name"), | ||
multiple = c(FALSE, FALSE), | ||
labels = c("Choose the variable denoting the date of birth", | ||
"Choose the variable corresponding to the patient's name") | ||
) | ||
}) | ||
output$mapcolumns_output <- renderUI({ | ||
mapcolumns_module()$ui() | ||
}) | ||
mapcolumns <- reactive({ mapcolumns_module()$server() }) | ||
|
||
output$plot <- renderPlot({ | ||
# Your plot goes here | ||
# plot(main_data()) | ||
|
||
# Generate the plot when the user clicks on the Analyze button | ||
if (input$analyze == 0) return() | ||
|
||
# You can access the mapped variables as reactive variables | ||
isolate({ | ||
plot(rnorm(100), xlab = mapcolumns()$dob(), ylab = mapcolumns()$name()) | ||
}) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.