R Markdown的新版本基于pandoc,因此您可以轻松更改输出格式.
我的问题是从回归模型中获取markdown格式表,因为LATEX和HTML表不能在pandoc转换中存活.
我知道从各种模型(stargazer,texreg,asprtable ......)生成LATEX/HTML输出的包,我知道函数/包,它们从数据框和矩阵生成降价表,但不从其他对象生成.
有什么建议?
我正在寻找一种方法(或替代方法)来获得stargazer html-table输出列之间的空格.
如
stargazer::stargazer(mtcars, type = "html")
Run Code Online (Sandbox Code Playgroud)
结果是
这不是很好读...
提前致谢!
塞缪尔
我想将复选框标签的帮助文本作为工具提示.在下面的示例中,我使用了shinyBS包 - 但我只能使用它来处理复选框输入组的标题.
任何想法如何在"Lernerfolg"或"Enthusiasmus"标签之后起作用?
library(shiny)
library(shinyBS)
server <- function(input, output) {
output$distPlot <- renderPlot({
hist(rnorm(input$obs), col = 'darkgray', border = 'white')
output$rendered <- renderUI({
checkboxGroupInput("qualdim", tags$span("Auswahl der Qualitätsdimension",
tipify(bsButton("pB2", "?", style = "inverse", size = "extra-small"),
"Here, I can place some help")),
c("Lernerfolg" = "Lernerfolg" ,
"Enthusiasmus" = "Enthusiasmus"
),
selected = c("Lernerfolg"))
})
})
}
ui <- fluidPage(
sidebarLayout(
sidebarPanel(
sliderInput("obs", "Number of observations:", min = 10, max = 500, value = 100),
uiOutput("rendered")
),
mainPanel(plotOutput("distPlot"))
) …Run Code Online (Sandbox Code Playgroud) 我通过RStudio准备了RMarkdown中的ioslides演示文稿.由于演示文稿包含大量引用,因此它们会被截断:
随着{.allowframebraks}似乎有一个快速的解决方案beamer演示为这个答案说明.还有一个用于ioslides吗?
我知道如何使用额外的 Latex 包从 .Rmd 文件输出 pdf 格式
---
header-includes:
- \usepackage{mathtools}
---
Run Code Online (Sandbox Code Playgroud)
在 YAML 标头中。
但是,如果指定output: html_document.
---
output: html_document
header-includes:
- \usepackage{mathtools}
---
Run Code Online (Sandbox Code Playgroud)
使用额外的 Latex-Packages 也可能对 感兴趣output: html_document- 特别是在数学表达式中(下面的 MWE)
---
title: "MWE"
output: html_document
header-includes:
- \usepackage{mathtools}
---
## Use "Defined by" Symbol
$$sin(x) \coloneqq \frac{opposite}{hypothenuse}$$
Run Code Online (Sandbox Code Playgroud) 我无法renderImage()使用 .svg 文件。我的最小示例(改编自相应的 RStudio-tutorial):
shinyUI(pageWithSidebar(
headerPanel("renderSVG example"),
sidebarPanel(
sliderInput("obs", "Number of observations:",
min = 0, max = 1000, value = 500),
actionButton("savePlot", "savePlot")
),
mainPanel(
# Use imageOutput to place the image on the page
imageOutput("plot"),
imageOutput("plot_as_svg")
)
))
Run Code Online (Sandbox Code Playgroud)
require("ggplot2")
library(svglite)
shinyServer(function(input, output, session) {
## create plot with renderPlot()
output$plot<- renderPlot({
hist(rnorm(input$obs), main="Generated in renderPlot()")
})
## create .svg file of the plot and render it with renderImage()
output$plot_as_svg <- renderImage({
# A …Run Code Online (Sandbox Code Playgroud) 在 RMarkdown 中我通常使用类似
```{r}
knitr::include_graphics("myimage.png")
```
Run Code Online (Sandbox Code Playgroud)
将已有的图像添加到输出中,但这不能通过exams2xyz().
fig.path = "", fig.caption = ""并不能解决问题。
经典的 Markdown 方式也行不通。
有什么想法吗,我哪里错了?
编辑:感谢@jaySF,我现在意识到工作目录问题,但仍然面临将数字嵌入(例如)用于moodle导入的.xml问题的挑战。