我仍然對r和閃亮的新手感興趣,而且我很難理解本來應該是簡單邏輯的東西。我正在嘗試在imageOutput窗口小部件中顯示pdf文件,但沒有運氣。有人能把我引向正確的方向嗎?顯示來自本地驅動器的pdf格式的pdf格式
樣品ui.R
shinyUI(pageWithSidebar(
mainPanel(
selectInput("sel_ed",
label = "View outputs for Ecodistrict:",
choices = c(244,245,247,249),
selected = NULL,
multiple = FALSE),
imageOutput("imp_pdf",width="500px",height="500px")
))
樣品server.R
shinyServer(function(input, output, session) {
importance <- function(inputSpecies){
img_dir <- pdf(paste(inputSpecies,"\\models\\MATL\\MATRF_Importance",sep=""))
}
output$imp_pdf <- renderImage({importance(input$sel_ed)})
})
大部分的錯誤,我得到的與預期的特徵向量參數,或原子向量做。我知道,閃亮或多或少的設計來呈現圖像或情節,但必須有一種方法來顯示本地驅動器上的pdf。
可能不相關,但你可以用'/'的路徑,而不是\\甚至在Windows – beroe
我認爲這是目前沒有現成的組件。但是,當然你可以在網頁上顯示PDF。如果它可以在網狀空間中完成,那麼閃亮就可以適應它。請參閱https://github.com/mozilla/pdf.js – xiaodai