Guest User

Untitled

a guest
Jun 24th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. (...)
  2. #list to store the datasets
  3. datasets.list = list()
  4.  
  5. #adds first dataset created to the list
  6. observe({
  7. if(length(datasets.list) < 1 & !is.null(dataset())){
  8. datasets.list[['dataset()']] = dataset()
  9. }
  10. })
  11.  
  12. #renders the UI according to the stored datasets
  13. output$datasets1 <- renderUI({
  14. radioButtons('datasets', 'Selected dataset:', choices = names(datasets.list[]))
  15. })
  16.  
  17. #the current dataset the user is working with according to the selection
  18. dataset.current <- reactive ({
  19. if (length(datasets.list) > 0 & !is.null(dataset())){
  20. return(datasets.list[[input$datasets]])
  21. }
  22. })
  23. (...)
  24.  
  25. #(e.g.) Applying background correction to the current dataset, creating another one
  26. dataset.bg <- reactive({
  27. input$preprocess
  28. isolate({
  29. if (!is.null(dataset()) & input$pMethods == 'bgCor') {
  30. return (data_correction(dataset.current(),"background"))
  31. }
  32. })
  33. })
  34.  
  35. #Add created dataset to list
  36. observe({
  37. if(!is.null(dataset.bg())){
  38. datasets.list[['dataset.bg()']] = dataset.bg()
  39. }
  40. })
Add Comment
Please, Sign In to add comment