我试图将仪表板的一些代码分解为模块.我在使用此rCharts代码时遇到问题.我可以将它作为一个应用程序运行,但理想情况下我想将它分成UI和server函数,以便我可以将它们保存在一个包中.
下面的代码显示了应用程序中的工作代码以及作为模块的损坏代码.任何人都可以指出我做错了吗?
谢谢
---
title: "Example"
output:
flexdashboard::flex_dashboard:
runtime: shiny
---
```{r setup, include=FALSE}
library(flexdashboard)
library(shiny)
library(rCharts)
X <- data.frame(Var1 = rep(1:10, 3),
Var2 = rep(c("control", "treatment1", "treatment2"), each = 10),
Freq = abs(rnorm(30, 0, 1))
)
```
Column {data-width=650}
-----------------------------------------------------------------------
### Broken Code as Module
```{r}
ui2 = function(id) {
ns = NS(id)
mainPanel(plotOutput("plot1", height = "100%"),
showOutput(ns("histogram"), "nvd3"))
}
server2 = function(input, output, session) {
output$histogram <- renderChart2({
n2 <- nPlot(Freq ~ …Run Code Online (Sandbox Code Playgroud) 我正在R中建立具有多个页面(标签)的flexdashboard。当我减小页面的宽度时,导航栏变为两行或更多行,并且重叠/覆盖主面板的内容。
如何固定导航栏,使其无论宽度调整如何都保持一行?或者如何在导航栏和主面板之间添加填充以防止重叠?
我已附上以下正确视图和有问题的视图的图像。
无论宽度调整如何,我想要的是:无重叠,仍然显示容器标题“图表B”
减小宽度时重叠:导航栏覆盖主面板,并且现在覆盖了容器标题“图B”
编辑:这是用于提供上述两个图像的flexdashboard脚本。
---
title: "Untitled"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
---
```{r setup, include=FALSE}
library(flexdashboard)
```
Long Tab 1
============================================================
### Chart A
```{r}
```
Another Long Tab 2
============================================================
Column {data-width=350}
-----------------------------------------------------------------------
### Chart B
```{r}
```
Another Long Tab 3
============================================================
### Chart C
```{r}
```
Another Long Tab 4
============================================================
Another Long Tab 5
============================================================
Another Long Tab 6
============================================================
Run Code Online (Sandbox Code Playgroud) 我有以下RMarkdown FlexDashboard文档:
---
title: "Some title"
runtime: shiny
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
---
```{r setup, include=FALSE}
library(flexdashboard)
```
Column {data-width=650}
-----------------------------------------------------------------------
### Some chart
```{r}
plot(faithful)
```
Column {data-width=650}
-----------------------------------------------------------------------
### Chart 2
```{r}
```
### Chart 3
```{r}
```
Run Code Online (Sandbox Code Playgroud)
如何使用以下内容放置跨页面的页脚?
tags$div( HTML("<footer><small>© Copyright 2017, MyCompany Co.,Ltd</small></footer>"))
Run Code Online (Sandbox Code Playgroud)
我正在使用的项目rMarkdown和flexdashboard来自的包rStudio.一切都很好地融合在一起.但我想删除您在此处顶部看到的蓝色标题栏.
我们将这个html页面放到一个窗口中,因此它成为第二个标题栏,看起来很糟糕.是否有功能flexdashboard删除整个设备?
这是YAML和你在照片中蓝色条下方看到的第一块.任何建议将不胜感激.
---
title: New Hampshire Statewide Age Adjusted Incedence Rates of Lyme
output:
flexdashboard::flex_dashboard:
orientation: rows
---
```{r setup, include=FALSE, message=FALSE, warning=FALSE, echo=TRUE}
```
Row
-----------------------------------------------------------------------
###
```{r, aarState, message=FALSE, warning=FALSE}
library(flexdashboard)
library(rbokeh)
#load state-wide age adjusted rates
aar<-read.csv("stateAAR.csv")
figure(title=" Age Adjusted Rates by Year",width= 1500, height =600) %>%
ly_segments(year, lci*100000, year, uci*100000, data=aar, color = "#b37700", width = 1) %>%
ly_points(year, adj.rate*100000, glyph = 21, size=6, data = aar, …Run Code Online (Sandbox Code Playgroud) 我正在尝试在 flexdashboard 中添加公司徽标。如官方页面所述,我们需要提供图像路径,我正在做与下面给出的相同的操作,但无法在仪表板中添加徽标。想知道如何在 flexdashboard 中引入 logo 以及如何在仪表板的顶部栏中添加自定义颜色。
---
title: "Dashboard"
output:
flexdashboard::flex_dashboard:
logo: C:/Users/Gaurav/Desktop/Test/www/BoA1.png
vertical_layout: scroll
orientation: rows
theme: cosmo
runtime: shiny
---
Run Code Online (Sandbox Code Playgroud)
flexdashboard 给出的是仪表板的屏幕截图,突出显示的是无法正常工作的徽标。
我有一个flexdashboard Rmd,当我按下RStudio中的Knit按钮时,它正确呈现.我想从命令行渲染它,但是当我使用命令时,naviagation栏确实会改变render("myfile.rmd", flex_dashboard())
我的Rmd文件的标题如下:
---
title: "Flexdashboard"
output:
flexdashboard::flex_dashboard:
theme: cosmo
navbar:
- { title: "Draft-For Internal Use Only", align: right }
source_code: embed
---
Run Code Online (Sandbox Code Playgroud) 我想将 Flexdashboard 上的每个框涂成不同的颜色。例如,我希望框 1 内的背景为蓝色,框 2 内的背景为绿色,依此类推。
有人能告诉我这是否可行吗?如果可以,请问该怎么做?
我在下面附上了一段示例代码。
由于要输入不止一项信息,我无法使用值框。
非常感谢,
title: "Example"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
---
```{r setup, include=FALSE}
library(flexdashboard)
```
Column {data-width=450}
-----------------------------------------------------------------------
### Box 1
```{r}
x = 5
y =6
```
In this example `r x` is smaller than `r y`
### Box 2
```{r}
x = 5
y =6
z= 4
```
In this example `r x` is smaller than `r y` but bigger than `r z`
Column {data-width=450}
-----------------------------------------------------------------------
### Box …Run Code Online (Sandbox Code Playgroud) 我在更改 DownloadButton 宽度时遇到问题,因为他与 actionButton (具有宽度参数)不同。
有什么简单的想法可以解决吗?这是我的代码(只是一个简单的下载按钮):
Normalidade
=======================================================================
Inputs {.sidebar}
-----------------------------------------------------------------------
<h5>
```{r}
tags$hr()
downloadButton("downloadNormal",label = "Download seu teste", class = "butt1")
downloadHandler(
filename = "Resultados_Normal.csv",
content = function(file) {
write.csv(data, file)
}
)
tags$hr()
tags$br()
actionButton("AjudaNormal", label = " Ajuda", icon("question-circle"),
width = "100%",
onclick="window.open('http://google.com', '_blank')")
```
</h5>
Run Code Online (Sandbox Code Playgroud) 我在将公司徽标添加到 Flexdashboard 输出时遇到问题。我调查了这个问题并尝试使用相对路径,并将图像大小调整为 48x48。当我运行该文档时,我仍然收到损坏的 html 图像。有谁知道可能出了什么问题吗?这是我的 YAML:
title: "title"
output:
flexdashboard::flex_dashboard:
orientation: columns
source_code: embed
logo: FoodBev.png
runtime: shiny
Run Code Online (Sandbox Code Playgroud)
另外,该图像位于我的工作目录中。感谢您的帮助!
我正在尝试使用 CSS 修改 flexdashboard 中选项卡集的一些样式。以下是 RMarkdown 文件的示例。
---
title: "Title"
output:
flexdashboard::flex_dashboard
---
Section
===========================================================
Column {.tabset .tabset-fade}
-----------------------------------------------------------------------
### tab1
text1
### tab2
text2
Run Code Online (Sandbox Code Playgroud)
我想将活动选项卡顶部的颜色从蓝色更改为其他颜色。
我能得到的最接近的是改变所有选项卡的颜色而不是顶部的颜色。
---
title: "Title"
output:
flexdashboard::flex_dashboard
---
<style>
.tabset {
background-color: #00806E;
}
</style>
Section
===========================================================
Column {.tabset .tabset-fade}
-----------------------------------------------------------------------
### tab1
text1
### tab2
text2
Run Code Online (Sandbox Code Playgroud)
flexdashboard ×10
r ×9
shiny ×5
r-markdown ×4
css ×1
dashboard ×1
rcharts ×1
rstudio ×1
titlebar ×1