From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/18087 Path: news.gmane.org!.POSTED!not-for-mail From: Andrew Scotchmer Newsgroups: gmane.text.pandoc Subject: Pandoc Error with Rmarkdown and Shiny Date: Fri, 25 Aug 2017 01:24:04 -0700 (PDT) Message-ID: <1c67925b-ebef-4e18-ba6d-477292e07160@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1939_1539817256.1503649444868" X-Trace: blaine.gmane.org 1503649456 20970 195.159.176.226 (25 Aug 2017 08:24:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 25 Aug 2017 08:24:16 +0000 (UTC) To: pandoc-discuss Original-X-From: pandoc-discuss+bncBC26HAUR2IDBBJN577GAKGQEJJNLZYA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Aug 25 10:24:12 2017 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-it0-f59.google.com ([209.85.214.59]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dl9uJ-0004ds-NI for gtp-pandoc-discuss@m.gmane.org; Fri, 25 Aug 2017 10:24:00 +0200 Original-Received: by mail-it0-f59.google.com with SMTP id k73sf421547itk.1 for ; Fri, 25 Aug 2017 01:24:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=gqr0LqCtwh6ynHlUAy3ZJNwR/OmaqCIY5TyBwa6C8p4=; b=C3jhgeOapdkR1/Yh3U+oSAuOAeYUUb04jmnEvQBD4NfnUdwRN79ChZZpiAZ6i5voRs SsGHY2cLyvlcwYdm9G1Pn9whoP5sMNz05IO3x6HYtklGaB1jNXqaWX5ywwSEw9SvicVt Zdlu3S/RJ4aWzaZeUvKT1fRygvZFFLGA9B1t8ExHUcO1uz6vvSD9cepPDxF8I737V9gf KZe68pwPuLuh4T76Lnp8bJhBKONJR59XvWL/fL8KXC2UzGah/+Yk5Slgr0k7odzr85DN n/du3Y0UdrSTeo6VlqIodSFm8Xc8l4JblAddeksNpJ9EZS/QU8xIua/qg+rLH5DyOnAH ungA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:subject:mime-version:x-original-sender :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=gqr0LqCtwh6ynHlUAy3ZJNwR/OmaqCIY5TyBwa6C8p4=; b=XHLmXFs9r2pf1UphOEmGRFqc3Y3PXuM7fdrs/zR+234ysByGcO2jhhYZQUrrUYbJet vfomcFgam+lM8Ud31TqFmr1FHDHrSetnXVyxfZGiIqP+CpVC88JNSdAAqILJ+pdvtuaY YMqes5ZM/LfHxs/4BhxW7j8eOTlGV29luyvoe1IwltMX7HDfEqiQXlJ2Rzn+IFqNzjhj rZv7NhAzkJ2PjiTJSG7SQo/bBgYXglTVCT/gY+49Pt98SlU0gRQbULBLZbSfUc4uz4Jk Q2N915c/ejlGCgH194KyonYLO5X6Zs4zGBwwWZEpEbkdbv6l4vh5AowjJwMKUQd9rkum WdHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:message-id:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=gqr0LqCtwh6ynHlUAy3ZJNwR/OmaqCIY5TyBwa6C8p4=; b=PuQXz5PM04gOLuh7y6odjlbiABSGnq78jMaba5YgKAAx3nqY6NHqQzMRzGrP0egqAk 2oTDfAHpd0CfEP5HAEYemJ3YxcO9r/apt3oPkXJOLqY9sgznV4XQZaEHxm6/IP11Y6HT hz7/b0Yw2SUygNju/nojNgEfJP6nXRCQY4apjRFPU9WDxH2VDSiG4ttWHwPFbMXfxRQr eFu0yDtPQIzX1nfLmU5oYutZg5EG5+97GNhj3MPeKLssefTAmfbFAzVAb29k50CVJstR YbqiXoP4DR3a+PcRXWXIQ9m83DKJ9QO2eGvJiTS8iRG19WJcZ1FTHP3nvYbzIN+cx0jx Ia/w== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AHYfb5gYf65FXLQXPnRTXTqIC9L/9AF0VRmVbNzw+94vfqnA6R/xRqKW QA3pBOvtiU6Zhg== X-Received: by 10.36.110.20 with SMTP id w20mr57971itc.7.1503649446491; Fri, 25 Aug 2017 01:24:06 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.107.48.149 with SMTP id w143ls766247iow.54.gmail; Fri, 25 Aug 2017 01:24:05 -0700 (PDT) X-Received: by 10.36.1.198 with SMTP id 189mr58522itk.9.1503649445367; Fri, 25 Aug 2017 01:24:05 -0700 (PDT) X-Original-Sender: andrew.scotchmer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:18087 Archived-At: ------=_Part_1939_1539817256.1503649444868 Content-Type: multipart/alternative; boundary="----=_Part_1940_1091333936.1503649444869" ------=_Part_1940_1091333936.1503649444869 Content-Type: text/plain; charset="UTF-8" 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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. ------=_Part_1940_1091333936.1503649444869 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

I have a simple=C2=A0R sh= iny app.=C2=A0 Whenever I try and download the table I created I get the fo= llowing error:

pandoc: Cannot decode = byte '\xfe': Data.Text.Internal.Encoding.Fusion.streamUtf8: Invalid= UTF-8 stream
Warning: Error in : pandoc document conversion failed wit= h error 1 Stack trace (innermost first):
=C2=A0 =C2=A0 53: pandoc_conve= rt
=C2=A0 =C2=A0 =C2=A052: convert
=C2=A0 =C2=A0 51: rmarkdown::rende= r
=C2=A0 =C2=A0 50: download$func [/home/scotcan1/Webshot/app.R#50]
= =C2=A0 =C2=A0 =C2=A0 1: shiny::runApp
Error : pandoc document conversio= n failed with error 1


I don't know what=C2=A0this means.=C2=A0=C2=A0 Here is= my R/Shiny script and Rmarkdown.

R:
library(shiny)
library
(DT)
data
(iris)=
ui = <- fluidPage(
=C2=A0
=C2=A0 titlePanel
("|Species Table"= (
=C2=A0 =C2=A0 sidebarPanel
= (

= =C2=A0 =C2=A0 =C2=A0 selectInput
("specs",
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
"Number of bins:"= ;,iris$Species)),
=C2=A0 =C2=A0 =C2=A0 downloadButton
("download&= quot;, "Download Report")
=C2=A0 =C2=A0
),
=C2=A0 =C2=A0 =C2=A0 =C2=A0 mainPanel
(
=C2=A0 =C2=A0 =C2=A0 tableOutput
("spec= Table")
=C2=A0 =C2=A0
)
=C2=A0 =C2=A0
=C2=A0
)
=C2=A0 )<- function(input, output) {
=C2=A0
=C2=A0 subSpec =
function(x){
=C2=A0 =C2=A0 testdat
<- iris[iris$Species = =3D= =3D x, ]
=C2=A0 =C2=A0
return(testdat[1:10,])
=C2=A0
}

=C2= =A0
=C2=A0 reactiveFunction
<- reactive({ subSpec(input$specs
) })= =C2=A0
=C2=A0
=C2=A0 output$reactiveTable
<- renderDataTable= ({= reactiveFunction() }, rownames =3D FALSE)
=C2=A0
=C2=A0 output$spec= Table
<- renderUI({
=C2=A0 =C2=A0 dataTableOutput
("reactiveT= able")
=C2=A0 =C2=A0
=C2=A0
})
=C2=A0
=C2=A0
=C2=A0 =
=C2=A0 output$download
<- downloadHandler(
=C2=A0 =C2=A0 filenam= e
<- "report_file.html",
=C2=A0 =C2=A0
=C2=A0 =C2=A0 co= ntent
<- function(file){
=C2=A0 =C2=A0 =C2=A0 write
.csv(reactiveFunct= ion
(), "test_csv.csv", row.names =3D FALSE)
=C2=A0 =C2=A0 = =C2=A0
params <- list(data =3D reactiveFunction())
=C2=A0 =C2=A0 =C2=A0= rmarkdown
::render(filename, output_file =3D file)
=C2=A0 =C2=A0 }
= =C2=A0
)
}
shinyApp
(ui =3D ui, server =3D server)


R= markdown:
---
title
: "Untitled"
output
: html_document<= br>params:
=C2=A0 data
: NA
---

```{r, echo=3DFALSE}
data(ir= is)
library(DT)
datatable(params$data)
```



Any h= elp to interpret the error appreciated.

Andrew

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-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.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_1940_1091333936.1503649444869-- ------=_Part_1939_1539817256.1503649444868--