Hi

I have a simple R shiny app.  Whenever I try and download the table I created I get the following error:

pandoc: Cannot decode byte '\xfe': Data.Text.Internal.Encoding.Fusion.streamUtf8: Invalid UTF-8 stream
Warning: Error in : pandoc document conversion failed with error 1 Stack trace (innermost first):
    53: pandoc_convert
     52: convert
    51: rmarkdown::render
    50: download$func [/home/scotcan1/Webshot/app.R#50]
      1: shiny::runApp
Error : pandoc document conversion failed with error 1


I don't know what this means.   Here is my R/Shiny script and Rmarkdown.

R:
library(shiny)
library
(DT)
data
(iris)
ui
<- fluidPage(
 
  titlePanel
("|Species Table"),
 
  sidebarLayout
(
    sidebarPanel
(
      selectInput
("specs",
                 
"Number of bins:",
                  unique
(iris$Species)),
      downloadButton
("download", "Download Report")
   
),
   
    mainPanel
(
      tableOutput
("specTable")
   
)
   
 
)
 
)
server
<- function(input, output) {
 
  subSpec
<- function(x){
    testdat
<- iris[iris$Species == x, ]
   
return(testdat[1:10,])
 
}
 
  reactiveFunction
<- reactive({ subSpec(input$specs) })
 
 
  output$reactiveTable
<- renderDataTable({ reactiveFunction() }, rownames = FALSE)
 
  output$specTable
<- renderUI({
    dataTableOutput
("reactiveTable")
   
 
})
 
 
 
  output$download
<- downloadHandler(
    filename
<- "report_file.html",
   
    content
<- function(file){
      write
.csv(reactiveFunction(), "test_csv.csv", row.names = FALSE)
     
params <- list(data = reactiveFunction())
      rmarkdown
::render(filename, output_file = file)
   
}
 
)
}
shinyApp
(ui = ui, server = server)



Rmarkdown:
---
title
: "Untitled"
output
: html_document
params:
  data
: NA
---

```{r, echo=FALSE}
data(iris)
library(DT)
datatable(params$data)
```



Any help to interpret the error appreciated.

Andrew

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/1c67925b-ebef-4e18-ba6d-477292e07160%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.