小编sam*_*erk的帖子

Markdown格式的回归表(在R Markdown v2中灵活使用)

R Markdown的新版本基于pandoc,因此您可以轻松更改输出格式.

我的问题是从回归模型中获取markdown格式表,因为LATEX和HTML表不能在pandoc转换中存活.

我知道从各种模型(stargazer,texreg,asprtable ......)生成LATEX/HTML输出的包,我知道函数/包,它们从数据框和矩阵生成降价表,但不从其他对象生成.

有什么建议?

r pandoc knitr r-markdown

14
推荐指数
3
解决办法
2万
查看次数

stargazer type ="html"表输出中列之间的空格

我正在寻找一种方法(或替代方法)来获得stargazer html-table输出列之间的空格.

stargazer::stargazer(mtcars, type = "html")
Run Code Online (Sandbox Code Playgroud)

结果是

在此输入图像描述

这不是很好读...

提前致谢!

塞缪尔

r stargazer

8
推荐指数
2
解决办法
3163
查看次数

用于帮助文本的闪亮UI中的工具提示

我想将复选框标签的帮助文本作为工具提示.在下面的示例中,我使用了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)

r shiny shinybs

7
推荐指数
1
解决办法
4155
查看次数

在RMarkdown ioslides演示文稿中截断的引用页面

我通过RStudio准备了RMarkdown中的ioslides演示文稿.由于演示文稿包含大量引用,因此它们会被截断: 在此输入图像描述 随着{.allowframebraks}似乎有一个快速的解决方案beamer演示为这个答案说明.还有一个用于ioslides吗?

knitr r-markdown ioslides

7
推荐指数
1
解决办法
607
查看次数

在 RMarkdown `output = "html_document"` 中为数学表达式使用额外的 Latex 包

我知道如何使用额外的 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)

mathjax knitr r-markdown

6
推荐指数
1
解决办法
1515
查看次数

闪亮应用程序中的 renderImage() 和 .svg

我无法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)

r shiny

5
推荐指数
1
解决办法
4446
查看次数

如何将现有图像添加到 R 考试问题中

在 RMarkdown 中我通常使用类似

```{r}
knitr::include_graphics("myimage.png")
```
Run Code Online (Sandbox Code Playgroud)

将已有的图像添加到输出中,但这不能通过exams2xyz().
fig.path = "", fig.caption = ""并不能解决问题。
经典的 Markdown 方式![alt text](figures/img.png)也行不通。

有什么想法吗,我哪里错了?

编辑:感谢@jaySF,我现在意识到工作目录问题,但仍然面临将数字嵌入(例如)用于moodle导入的.xml问题的挑战。

r r-exams

5
推荐指数
1
解决办法
1407
查看次数

标签 统计

r ×5

knitr ×3

r-markdown ×3

shiny ×2

ioslides ×1

mathjax ×1

pandoc ×1

r-exams ×1

shinybs ×1

stargazer ×1