出现错误:尝试使用 slickR 为多个输入输出幻灯片时,“闭包”类型的对象不是子集错误,我该如何解决?
observeEvent(input$imagepreview, {
output$x <- renderImage({
if (is.null(input$picture))
return(NULL)
if (input$picture == "Round Eye") {
return(list(
src = "images/roundeye.jpg",
filetype = "image/jpeg",
alt = "Face"
))
}else if (input$picture == "Wayfarer" && input$arm == "Red" && input$body == "Yellow") {
return(
output$slickR <- renderSlickR({
imgs <- list.files("C:/", pattern=".jpg", full.names = TRUE)
slickR(imgs)
})
)
}
else if (input$picture == "Square" && input$arm == "Blue" && input$body == "Green") {
return(list(
src = "images/wayfarercustom.jpg",
filetype = "image/jpeg",
alt = "This is a chainring"
))
}
}, deleteFile = FALSE) })