Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (...)
- #list to store the datasets
- datasets.list = list()
- #adds first dataset created to the list
- observe({
- if(length(datasets.list) < 1 & !is.null(dataset())){
- datasets.list[['dataset()']] = dataset()
- }
- })
- #renders the UI according to the stored datasets
- output$datasets1 <- renderUI({
- radioButtons('datasets', 'Selected dataset:', choices = names(datasets.list[]))
- })
- #the current dataset the user is working with according to the selection
- dataset.current <- reactive ({
- if (length(datasets.list) > 0 & !is.null(dataset())){
- return(datasets.list[[input$datasets]])
- }
- })
- (...)
- #(e.g.) Applying background correction to the current dataset, creating another one
- dataset.bg <- reactive({
- input$preprocess
- isolate({
- if (!is.null(dataset()) & input$pMethods == 'bgCor') {
- return (data_correction(dataset.current(),"background"))
- }
- })
- })
- #Add created dataset to list
- observe({
- if(!is.null(dataset.bg())){
- datasets.list[['dataset.bg()']] = dataset.bg()
- }
- })
Add Comment
Please, Sign In to add comment