The problem is in the format of the output: There is a c(...) in front of the file names. In other words, I do not understand why the symbol "c" (vector) appears in front of the files. Additionally, there is a "backwards slash" symbol at the beginning and end of each file name which does not appear in this editor. This happens while rendering the output, which I forgot to include in my previous post - verbatimTextOutput("list") -.
[1] "c("150413_JF_GPeps_SIDtarg_GPstdMix_Tryp_2runs_v3_PSMs.txt", "160824_JF_udep_tryp_Hi_SIDdda_FULL_NewParse-(05)_PSMs.txt") 3"
[2] "c("160824_JF_udep_tryp_Hi_SIDdda_FULL_NewParse-(05)_PSMs.txt", "JF_160426_Dep2Plas_ctryp_Gpep_SIDtargFULL__PSMs.txt") 3"
[3] "c("160824_JF_udep_tryp_Hi_SIDdda_FULL_NewParse-(05)_PSMs.txt", "JF_160426_Dep2Plas_ctryp_Gpep_SIDtargFULL__PSMs.txt") 3".
However, If I send the list of lists to another function: output$listOfLists <- renderPrint({
req(myValues$fList)
shinyjs::show("saveBTN")
if(input$saveBTN > 0)
result <- glycoPipe(inFileName(), myValues$fList )
})
and I print the list using print(), I get the desired output. Please see below.
[[1]]
[1] "150413_JF_GPeps_SIDtarg_GPstdMix_Tryp_2runs_v3_PSMs.txt" "160824_JF_udep_tryp_Hi_SIDdda_FULL_NewParse-(05)_PSMs.txt"
[[2]]
[1] "150413_JF_GPeps_SIDtarg_GPstdMix_Tryp_2runs_v3_PSMs.txt" "160824_JF_udep_tryp_Hi_SIDdda_FULL_NewParse-(05)_PSMs.txt"
[[3]]
[1] "150413_JF_GPeps_SIDtarg_GPstdMix_Tryp_2runs_v3_PSMs.txt" "160824_JF_udep_tryp_Hi_SIDdda_FULL_NewParse-(05)_PSMs.txt"
[3] "JF_160426_Dep2Plas_ctryp_Gpep_SIDtargFULL__PSMs.txt"
A simple example would be:
ui <- fluidPage(
headerPanel("Test"),
textInput('txt','','Text'),
#selectInput("filescombine",label = h5(strong("PLEASE CHOSE FILES TO COMBINE. To undo selection select the selected file again and press the delete key on your keyboard.
# If you wish to make more sets, PLEASE PRESS ADD BUTTON AND CHOSE FILES TO COMBINE")),c(Choose='', list.files("~/Development/fileTest/GLYCOUNT/DATA")), multiple=TRUE, selectize=TRUE),
actionButton('add','add'),
verbatimTextOutput("list")
)
server <- function(input, output, session){
myValues <- reactiveValues(List = list())
observe({
if(input$add > 0){
myValues$List <- c(isolate(myValues$List), isolate(list(input$txt)))
# myValues$List <- c(isolate(myValues$List), isolate(list(input$filescombine)))
}
})
output$list<-renderPrint({
myValues$List
result <- receivelist(myValues$List)
value <- paste(result$x, result$L)
value
})
}
receivelist <- function(myList){
x <- list()
x <- append(x, myList)
L <- length(x)
#print(paste(x, length(x)))
list(x = x, L = L)
}
shinyApp(ui = ui, server = server)
But the output here does not display the vector c("\filename") symbol.