我正在使用一些R闪亮组件编写交互式R-markdown报告,以显示一些探索性分析结果。
我使用renderPrint()
来显示来自describe()
的结果,如下所示。
renderPrint({
check_list <- c("CustomerSatisfaction","AssignedServiceFamily","ProductName","ReportedSource")
df_overview <- df[check_list]%>%
subset(ReportedSource %in% input$select0) %>%
subset(AssignedServiceFamily %in% input$select1) %>%
subset(ProductName %in% input$select2)
describe(df_overview)
})
CustomerSatisfaction 是一个具有5个不同值的字符变量。但是,r markdown输出不能在同一行上显示所有5个值,尽管页面宽度上仍有一些剩余空间,如下面的屏幕快照所示。
我试图通过如下设置选项来增加文件宽度。虽然降价输出的宽度相应增加,但renderPrint()
仍分两部分显示我的 CustomerSatisfaction 的结果。仅灰色背景区域的宽度增加。
<style>
body .main-container {
max-width: 1200px;
}
</style>
我还尝试如下设置renderPrint()
的width选项,但对我来说不起作用。
renderPrint({mycode},width = 800)
我的YAML标头设置如下。
---
title: "Title"
author: "Author"
date: "`r format(Sys.time(),'%Y-%m-%d')`"
output: html_document
theme: cosmo
runtime: shiny
---