- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
当 shiny-server 看到 .Rmd 文件而不是 ui.R 和 server.R 时,有什么方法可以减少右边距和左边距吗?正如您在下面看到的,将近一半的窗口是右边距和左边距。有没有办法修改内部 css
脚本来进行更改,或者是否有更简单的解决方案,通过在 markdown header 中添加 geometry
选项?
这是我在 Rstudio 中创建一个新的 Shiny Rmarkdown 文件时生成的示例代码:
---
title: "Untitled"
author: "Me"
date: "10/13/2015"
output: html_document
runtime: shiny
---
This R Markdown document is made interactive using Shiny. Unlike the more traditional workflow of creating static reports, you can now create documents that allow your readers to change the assumptions underlying your analysis and see the results immediately.
To learn more, see [Interative Documents](http://rmarkdown.rstudio.com/authoring_shiny.html).
## Inputs and Outputs
You can embed Shiny inputs and outputs in your document. Outputs are automatically updated whenever inputs change. This demonstrates how a standard R plot can be made interactive by wrapping it in the Shiny `renderPlot` function. The `selectInput` and `sliderInput` functions create the input widgets used to drive the plot.
```{r, echo=FALSE}
inputPanel(
selectInput("n_breaks", label = "Number of bins:",
choices = c(10, 20, 35, 50), selected = 20),
sliderInput("bw_adjust", label = "Bandwidth adjustment:",
min = 0.2, max = 2, value = 1, step = 0.2)
)
renderPlot({
hist(faithful$eruptions, probability = TRUE, breaks = as.numeric(input$n_breaks),
xlab = "Duration (minutes)", main = "Geyser eruption duration")
dens <- density(faithful$eruptions, adjust = input$bw_adjust)
lines(dens, col = "blue")
})
```
## Embedded Application
It's also possible to embed an entire Shiny application within an R Markdown document using the `shinyAppDir` function. This example embeds a Shiny application located in another directory:
```{r, echo=FALSE}
shinyAppDir(
system.file("examples/06_tabsets", package="shiny"),
options=list(
width="100%", height=550
)
)
```
Note the use of the `height` parameter to determine how much vertical space the embedded application should occupy.
You can also use the `shinyApp` function to define an application inline rather then in an external directory.
In all of R code chunks above the `echo = FALSE` attribute is used. This is to prevent the R code within the chunk from rendering in the document alongside the Shiny components.
最佳答案
查看由 Rmd 文件生成的 HTML 后,主要内容似乎位于类为 main-content
的 div 下,并且它有一个 max-width
属性(property)。查看rmarkdown
源代码,我相信也许会发生这种情况here .尝试添加一个 css 规则,例如 div.main-container { max-width: inherit;
关于html - 如何减少 Shiny 的交互式 rmarkdown 利润?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33114272/
我有这个脚本计算利润 步骤: barangbeli = 哈萨特/直径 p1 = 巴朗贝利 * 10 p2 = 教授/100 结果 = barangbeli + 利润; 谢谢 CREATE VIEW t
HTML CSS .col-3 { width:31.5%; float:left; margin-right:1.8%; margin-bott
根据交易时的成本价计算利润时出现问题 下面是场景的重现 create table price_history(id int,dated date,product_id int,cost_price i
当 shiny-server 看到 .Rmd 文件而不是 ui.R 和 server.R 时,有什么方法可以减少右边距和左边距吗?正如您在下面看到的,将近一半的窗口是右边距和左边距。有没有办法修改内部
这个问题在这里已经有了答案: Strange constraints behaviour on iPad (1 个回答) 关闭 7 年前。 我在不同的应用程序中有一段时间遇到这个问题,但我不知道到底
这真的很奇怪。我似乎根本无法通过 css 影响这张图片。尝试专门为图像添加一个类,并编写 css 以仅影响图像,但不影响 zip。它不会让步。唯一让它移动的是设置负值。实际图像上的边距,它只向上移动了
我是一名优秀的程序员,十分优秀!