首页 文章
  • 2 votes
     answers
     views

    kableExtra rmarkdown tables - 对齐分组行标签和脚注

    我使用 kableExtra 格式化Rmarkdown文档中的一些表格 . 当运行下面的代码时, kable_styling 没有任何 position 参数,分组行标签(表中的行显示"Group 1"和"Group 2")和脚注相对于表保持左对齐 . 这是我想要的 . ```{r cars-table, results='asis'} kable(mtca...
  • 4 votes
     answers
     views

    交叉引用不适用于rmarkdown beamer演示文稿

    我想通过Rmarkdown链接beamer_presentation中的节头(即,创建交叉引用或Pandoc's internal links) . 例如,我希望有一个链接,例如"see 'introduction'",通过单击此链接,演示文稿应跳转到 Headers 为'introduction'的幻灯片 . 我试过这段代码: --- output: beamer_prese...
  • 2 votes
     answers
     views

    闪亮的应用程序与可下载的md报告,错误:“pandoc:无法找到数据文件”由shiny-server运行时

    我创建了一个提供下载按钮的闪亮应用程序 . 按下时,将以html格式创建降价报告 . 这是应用程序: server <- function(input, output) { output$report <- downloadHandler( filename = "report.html", content = function(file){ ...
  • 5 votes
     answers
     views

    错误R Studio使用install.packages行编织HTML

    我是RStudio的新用户,在使用.rmd文件和Knit HTML时遇到错误 如果我有一个install.packages行: install.packages('ggplot2'); library(ggplot2); 当我单击Knit HTML时,会返回错误: contrib.url中的错误(repos,“source”):尝试在不设置镜像调用的情况下使用CRAN:... withVisi...
  • 0 votes
     answers
     views

    未找到调用:从r studio编织为HTML时出现<Anonymous>错误

    {r,eval=F} corfit &lt;- duplicateCorrelation(brain.rma, design.trt, block = blocks) {r histOfcorrelations} print(cor) {r} plot(hist(tanh(corfit$atanh.correlations))) 我的代码在RMD文件中运行得很好,但不会编织为HTML . h...
  • 0 votes
     answers
     views

    R降价编织错误读取csv [重复]

    这个问题在这里已有答案: Error: could not find function … in R 10个答案 knitr doesn't know new function (r-markdown) 1回答 我是新手使用R markdownn并且不明白为什么这个块工作正常但是在编织时失败了? {r echo=FALSE} dataframe &lt;- read_csv(&quot...
  • -1 votes
     answers
     views

    R markdown错误“对象'…'未找到”,dplyr [关闭]

    以下是.rmd文件内容的一部分 . ## Loading and preprocessing the data Load the data with dplyr and data.table package into a data table called activity. ```{Load, echo=TRUE} library(dplyr) library(data.table) acti...
  • 5 votes
     answers
     views

    调用rmarkdown :: render时,接收器已满

    我正在关注this short tutorial直接将我的R脚本打印为HTML文档 . 它应该非常简单 . 通过对其他正常R脚本的 Headers 和注释进行一些小的更改,在R脚本末尾调用命令 rmarkdown::render('/Users/you/Documents/yourscript.R') 应该调用 knitr::spin 函数从我的R脚本转到Rmd文件到最终的HTML或PDF . 我...
  • 1 votes
     answers
     views

    Rstudio / markdown / Word:tiff数字没有大小选项?

    我正在使用RStudio / markdown并希望生成一个Word文档 . 我有一个tiff-graphic,我想在文档中包含它 . 由于Word文档中的图形看起来很小,我想调整它的大小: ```{r , fig.align=&quot;center&quot;, echo=FALSE, out.width = &quot;600px&quot;} knitr::include_graphics...
  • 0 votes
     answers
     views

    以R Markdown为中心绘制一个dygraph图

    我试图将一个dygraph居中,但它仍保持左对齐 . 下面是我的最小例子,突出显示 fig.align='center' 如何使用正常情节: --- output: html_document --- ```{r fig.align='center'} plot(cars) library(dygraphs) lungDeaths &lt;- cbind(ldeaths, mdeaths, f...
  • 1 votes
     answers
     views

    无法在ggplot中重新排列传奇

    我正在使用rmarkdown编写代码并将输出显示为html文档 . 我有一个数据框,我想从中创建一个条形图 . 现在图例太长,所以它重叠并覆盖了图形的一部分 . 我尝试了很多东西,但无法对齐标签方向,图例方向 . 我只能使用(legend.position = &quot;none&quot;)删除图例 . 我甚至无法使用&quot;legend.position&quot;向左,向右,向下或向上...
  • 58 votes
     answers
     views

    Rstudio rmarkdown:单个PDF中的纵向和横向布局

    我想知道如何使用 rmarkdown 生成一个在同一文档中同时具有纵向和横向布局的pdf . 如果有一个纯粹的 rmarkdown 选项比使用乳胶更好 . 这是一个小的,可重复的例子 . 首先,在RStudio中渲染此 .Rmd (按 Knit PDF 按钮)会生成包含横向布局中所有页面的pdf: --- title: &quot;All pages landscape&quot; output:...
  • 1 votes
     answers
     views

    R markdown pdf输出数字out.width = '90%'使用render函数生成错误的路径并使用output_dir

    我正在使用output = pdf和xelatex从Rmd文件生成pdf . 有些数字较大,覆盖整个页面 . 因此生成的pdf会创建一个空页面 . 为了避免这种情况,我决定使用out.width = '90%'来减小数字的大小 . 这是我的.Rmd文件: --- title: &quot;test out width&quot; author: &quot;Courvoisier&quot; da...
  • 46 votes
     answers
     views

    如何在电子邮件正文中发送R降价报告?

    update: Brandon Bertelsen's answer : 布兰登的答案产生以下输出 . 它不会像Rstudio那样产生漂亮的表格或突出显示的代码,并且它会在一些带有unicode的html文件上崩溃,所以我没有用它来自动化我的电子邮件报告 . 我目前的方法是使用Rstudio编译为html,在chrome中打开html文档,然后将html文档复制并粘贴到gmail中 . 这很好用,...
  • 6 votes
     answers
     views

    网状 - 在Rmarkdown中运行python块

    也许我错过了一些东西,但如果下面的代码是我的Rmd文件的内容 ```{r} library(reticulate) use_virtualenv(&quot;r-reticulate&quot;) py_available(TRUE) a = 7 print(a) py$a 当我编织文件时,最后一个块的输出是7(如预期的那样) . 另一方面,单击Rstudio中的“全部运行”按钮(或逐个运...
  • 9 votes
     answers
     views

    编织HTML不保存html in vignettes /

    所以我有一个小插曲, vignettes/test-vignette3.Rmd : --- title: &quot;Sample Document&quot; output: html_document: highlight: kate theme: spacelab toc: yes pdf_document: toc: yes --- Header ...
  • 1 votes
     answers
     views

    Rmarkdown转换为pdf:显示基本直方图,但之后不显示输出

    下面的代码用于生成R中基本绘图系统的直方图,并通过Rmarkdown将其转换为pdf(Latex) . 我设置message = FALSE,warning = FALSE,error = FALSE等,但仍然从系统获得输出 . 我怎么才能显示情节? --- title: &quot;Test&quot; author: &quot;Me&quot; date: &quot;Tuesday, Se...
  • 1 votes
     answers
     views

    从源脚本中删除邮件

    我正在尝试使用 raster::extract(raster,spatialpolygons) 来源脚本,因此它会打印有关用于提取的多边形的消息 . 该文件的最终输出是我想要显示的ggplot,但我不希望显示来自R的任何消息 . ```{r percent of avg, echo=FALSE,message=FALSE,warning=FALSE,fig.width=15} source('sr...
  • 3 votes
     answers
     views

    UseMethod(“select_”)中的错误:'select_'的适用方法没有应用于类“NULL”的对象

    当 knitting 这个R Markdown进入HTML文件时,我收到一个奇怪的错误 . 我认为它与 dplyr 包中的某种不兼容性有关 knitr . UPDATE: I replaced the cbind chunk with the dplyr::bind_cols command, as someone suggested below not to use cbind with dp...
  • 2 votes
     answers
     views

    R markdown:将html表下载到excel文件

    我有一个R markdown,我 Build 了一个表,我想添加选项将表下载到excel文件 . kable(MyTable) %&gt;% kable_styling(bootstrap_options = c(&quot;striped&quot;, &quot;hover&quot;, &quot;condensed&quot;, &quot;responsive&quot;)) ...
  • 0 votes
     answers
     views

    R Markdown:Markdown工作区到R工作区

    也许这是一个简单的问题,但我还没有找到答案 . 当我将RMarkdown脚本编织到R中的工作区时,我想导出它创建的工作区,以继续在此工作区上工作 . 有没有办法做到这一点,或者我应该在R控制台中逐行运行我的块来构建类似RMarkdown工作区的工作区? 非常感谢 .
  • 3 votes
     answers
     views

    如何让RStudio将r-markdown发布到rpubs.org网站?

    根据a response from the RStudio team,&quot;standard&quot;解决方案将是follow the instructions for &quot;Using R Markdown with RStudio&quot;,并使用&quot;Publish&quot;按钮注意第三个屏幕截图上的按钮 . 一个非常简单的解决方案,我非常感激他们已经 Build ...
  • 1 votes
     answers
     views

    RStudio升级后未遵循绘图宽度/高度

    我正在使用带有RStudio的knitr,生成HTML报告 . 我的报告包含许多不同大小的地块,有些是小的,有些则更宽 . 我使用fig.width和fig.height每块来指定大小 . 直到昨天我使用了RStudio 0.98.50 *并且渲染得非常完美 - 每个地块都有自己的大小,如果某些地块太大,会出现水平滚动条 . 但是我想把TOC添加到报告中,然后升级到最新的RStudio 0.98....
  • 1 votes
     answers
     views

    knitr在HTML风格的注释中执行R代码块

    使用 Rstudio 编辑 Rmarkdown 文件,我使用HTML注释标记出我不想处理的大块或在输出中 . 这在Rstudio中运行得很好,它忽略了注释中的所有内容 . 但是,当我要求Rstudio编织文档时, knitr 正在评论中执行 R 代码块 . 这是一个MWE .Rmd文件: # Important stuff I want to see This is what I want to ...
  • 0 votes
     answers
     views

    为什么out.width在R Notebook中不起作用?

    我使用macOS High Sierra版本10.13.2和Rstudio版本1.1.414我想使用R笔记本注意,但我发现这里有四个关于指定图形大小的问题 . 我不能使用out.width或out_width来改变R Notebook中图形的大小 . 我无法使用fig_width&fig_height来改变R Notebook中图形的大小 . 我唯一可以改变图形大小的是R Notebo...
  • 0 votes
     answers
     views

    Rmarkdown到word文档 - 如何将图像(图片)对齐为中心

    我正在编辑一个rmd文件,它将编织成一个word文档,我想知道如何将图像(图片)对齐为中心,当我将其插入rmd文件并将kint插入到word中时,图像对齐为light . 当我在代码中使用fig.align ='center'时, ```{r color, echo=FALSE, fig.cap=figs(&quot;color&quot;)} knitr::include_graphics...
  • 0 votes
     answers
     views

    使用RStudio绘制设备

    我有问题在 .Rmd 中在RStudio中对我现有的情节绘制 lines . 我在 .Rmd (⌘返回)中的代码块中运行了代码, plot 在 .Rmd (RStudio v1.0的新功能)中给了我一个图表,但是当我运行第二个代码 lines 时,出现错误 . plot(density(with$glucose), ylim = c(0.00, 0.02), xlab = ...
  • 1 votes
     answers
     views

    在r markdown循环中使用flextable不生成表

    我有很多表要创建,我试图在循环中创建它们 . 我在rstudio中使用了rtabledown的flextable . 在循环中使用 print(theFlextable) 命令会生成文本列表而不是表 . 对于docx和html输出类型,会发生这种情况 . 如果我不使用循环flextable正确渲染 . 这是一个演示: --- title: &quot;Demo&quot; output: word...
  • 2 votes
     answers
     views

    在时间序列的背景下分解

    我有一个数据集,我想要整体可视化,并通过一些不同的变量分解 . 我创建了一个带有玩具闪亮应用程序的flexdashboard来选择分解类型,并使用工作代码来绘制正确的子集 . 我的方法是重复的,这对我来说是一个暗示,我错过了一个更好的方法来做到这一点 . 让我沮丧的是需要按日期计算并扩展矩阵 . 我不确定如何在一个管道中按周计算组数 . 我分几步完成并组合 . 思考? (ps . 我在RStudi...

热门问题