2014-07-24 27 views
7

biegnę następujące interaktywny dokument rmarkdown:Interaktywny dokument rmarkdown nie wyświetla poprawnie po przeglądarce odśwież

### Example of shiny app 

```{r, echo = FALSE, eval = TRUE} 
    numericInput("rows", "How many cars?", 5) 

renderTable({ 
    head(cars, input$rows) 
}) 
``` 

### Another example 

```{r, echo = FALSE} 
    sliderInput("bins", "Number of bins:", min = 1, max = 50, value = 30) 

    renderPlot({ 
    x <- faithful[, 2] # Old Faithful Geyser data 
    bins <- seq(min(x), max(x), length.out = input$bins + 1) 

    # draw the histogram with the specified number of bins 
    hist(x, breaks = bins, col = 'darkgray', border = 'white') 
    }) 
``` 

zapisany jako minimal.Rmd, biegnę go uruchamiając

rmarkdown::run("minimal.Rmd") 

na R konsola. Po uruchomieniu, że doc wyświetla poprawnie na przeglądarce:

App displayed correctly

po odświeżeniu przeglądarki, dokument wygląda następująco:

App displayed incorrectly

(Próbowałem to na chromie i safari)

Zauważyłem, że kiedy uruchamiam rmarkdown :: uruchamiam natychmiast po zapisaniu pliku .Rmd, otrzymuję wynik podobny do knitr na konsoli R, a dokument wyświetla się poprawnie; podczas uruchamiania rmarkdown :: run bez ponownego zapisywania plik nie tworzy wyjściowego podobnego do knitr na konsoli, a dokument jest wyświetlany niepoprawnie. Może to wynikać z rmarkdown :: uruchom buforowanie. Wyjście knitr-jak mogę to:

Listening on http://127.0.0.1:6381 


processing file: minimal.Rmd 
    |................             | 25% 
    |................................         | 50% 
    |.................................................    | 75% 
    |.................................................................| 100% 
label: unnamed-chunk-2 (with options) 
List of 1 
$ echo: logi FALSE 


output file: /var/folders/15/q9z0km897fs93f_z1slpf09h0000gp/T//Rtmpt7kc98/minimal.knit.md 

/usr/local/bin/pandoc /var/folders/15/q9z0km897fs93f_z1slpf09h0000gp/T//Rtmpt7kc98/minimal.utf8.md --to html --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output /var/folders/15/q9z0km897fs93f_z1slpf09h0000gp/T/rmarkdown/rmd_b468d17c42847143a4499f693d7a0f45.html --smart --email-obfuscation none --standalone --section-divs --template /Library/Frameworks/R.framework/Versions/3.1/Resources/library/rmarkdown/rmd/h/default.html --variable theme:bootstrap --mathjax --variable mathjax-url:https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML --no-highlight --variable highlightjs=rmd_b468d17c42847143a4499f693d7a0f45_files/highlight 

Output created: /var/folders/15/q9z0km897fs93f_z1slpf09h0000gp/T/rmarkdown/rmd_b468d17c42847143a4499f693d7a0f45.html 
Warning in addResourcePath(prefix, dependency$src$file) : 
    Overriding existing prefix rmarkdown-performance-0.1 => /private/var/folders/15/q9z0km897fs93f_z1slpf09h0000gp/T/rmarkdown/rmd_54619711603ff951c709d43a6cda206b_files 

Moja informacji sesja jest:

sessionInfo() 
R version 3.1.0 (2014-04-10) 
Platform: x86_64-apple-darwin13.1.0 (64-bit) 

locale: 
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8 

attached base packages: 
[1] stats  graphics grDevices utils  datasets methods base  

other attached packages: 
[1] shiny_0.10.0  rmarkdown_0.2.46 

loaded via a namespace (and not attached): 
[1] bitops_1.0-6 caTools_1.17 digest_0.6.4 evaluate_0.5.5 formatR_0.10 htmltools_0.2.4 
[7] httpuv_1.3.0 knitr_1.6  Rcpp_0.11.2  RJSONIO_1.2-0.2 stringr_0.6.2 tools_3.1.0  
[13] xtable_1.7-3 
+0

Mogę odtworzyć to w systemie Windows. Nie ma jeszcze rozwiązania. –

Odpowiedz

6

dodania:

--- runtime: shiny output: html_document ---

na górę dokumentu rozwiązuje ten problem. Answered autorstwa Fereshteh Karimeddini w grupie użytkowników Google z błyszczącymi użytkownikami.

Powiązane problemy