我有一个R文件,其中包含:
---
runtime:shiny
output:html_document
- --
### Here are two Shiny widgets
'''{r echo = FALSE}
selectInput("n_breaks", label = "Number of bins:",
choices = c(10, 20, 35, 50), selected = 20)
我有一个'build‘文件:
setwd('C:/Bla/Shiny/Markup')
rmarkdown::render("ShinyMarkUp.R")
这意味着从r文件中产生html文件: ShinyMarkUp.R (见上),在较旧的: C:/Bla/Shiny/Markup中
我得到了这个错误:
Quitting from lines 3-11 (ShinyMarkUp.spin.Rmd)
Error in parse(text = x, srcfile = src) :
<text>:6:3: unexpected INCOMPLETE_STRING
7: selectInput("n_breaks", label = "Number of bins:",
8: choices = c(10, 20, 35, 50), selected = 20)
^
我有什么地方做错了吗?谢谢!
发布于 2018-11-02 21:49:30
以防对其他人有帮助--创建文件ShinyMarkUp:
# Example RMarkdown document
This is an interactive document written in *markdown*. As you can see it is easy to include:
1. Ordered lists
2. *Italics*
3. **Bold type**
## This is heading two
Perhaps this introduces the visualisation below.
```{r, echo=FALSE}
sliderInput("sampleSize",label =“样本大小”,
最小值= 10,最大值= 100,值= 50,步长= 1)
renderPlot({
hist(runif(input$sampleSize))
})
并使用以下命令:
library(markdown)
library(shiny)
setwd('C:/Bla/Shiny/Markup')
rmarkdown::run("ShinyMarkUp.Rmd")
https://stackoverflow.com/questions/53119412
复制相似问题