r-markdown

Include Rmd appendix after references

 ̄綄美尐妖づ 提交于 2019-12-12 07:29:36
问题 My question is linked to this one. I wish to include my appendix after my references so I am using the after_body tag in my yaml, however I need to be able to knit my appendix.Rmd file. I have tried the following: after_body: "`r knitr::knit('appendix.Rmd')`" however this attempts to knit the appendix.Rmd file before the actual report and therefore fails as it does not have the required libraries or objects in memory. 回答1: In order to have appendices after the references, you simply include a

Centering image in RMarkdown for Word export

白昼怎懂夜的黑 提交于 2019-12-12 05:54:11
问题 I would like to include an image in a RMarkdown document and have it centered in the output Word. Is this possible? As suggested here, I have used: <center>![My caption](myImage.png)</center> without success. 回答1: This is not fully satisfactory, but what I did in the end was to add a macro in my styles document: Sub Center_All_Images() ' ' Center_All_Images Macro ' ' For Each oILShp In ActiveDocument.InlineShapes oILShp.Select Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Next

Error with loading png in Rmd file

╄→尐↘猪︶ㄣ 提交于 2019-12-12 05:25:16
问题 i am trying (invane) to load a png file in my Rmd file. I save both the Rmd and the png in the same folder on my main drive (I tested i can read/write files in there with R). When i run the following code --- title: "Determinants of profitability" author: "Daniele Frison" date: "26 November 2015" output: html_document: fig_height: 10 fig_width: 10 --- ```{r} ![aaa](prof_vs_costs.png) ``` I get inexorably this error message: |................................ | 50% ordinary text without R code

R markdown html document not properly show in Internet Explorer

不想你离开。 提交于 2019-12-12 05:16:42
问题 I create a rmarkdown html document and following is my code: --- title: "PA" output: html_document: css: custom.css theme: journal toc: true toc_float: collapsed: false smooth_scroll: false toc_depth: 4 --- <style> .list-group-item.active, .list-group-item.active:focus, .list-group-item.active:hover { background-color: blue; } </style> <style type="text/css"> #TOC { color: purple; } .toc-content { padding-left: 30px; padding-right: 40px; } h1 { /* Header 1 */ color: DarkBlue; } </style> <div

Rmarkdown html whitespace

隐身守侯 提交于 2019-12-12 05:09:44
问题 I am trying to add space between two tables and three graphs on an rmarkdown file that is knit into html. I was able to add space between two tables and add a header to the second table as follows end of first table code ``` \ ### Header For Second Table However when I go to use either another header between tables or add whitespace similarly to above, the header shows up on the side of the table like this and no whitespace is added. I am using pixiedust to make the tables and ggplot2 to make

R-Markdown - kableExtra package - format = 'latex' not working

て烟熏妆下的殇ゞ 提交于 2019-12-12 04:59:22
问题 Using the kableExtra documentation. inside RMardown I am running: ```{r} library(knitr) library(kableExtra) dt <- mtcars[1:5, 1:6] kable(dt, format = "rmarkdown") ``` this actually outputs a table but I also get the following in the console: Error in kable_rmarkdown(x = c("Mazda RX4", "Mazda RX4 Wag", "Datsun 710", : could not find function "kable_rmarkdown" when I switch to: ```{r} library(knitr) library(kableExtra) dt <- mtcars[1:5, 1:6] kable(dt, format = "latex") ``` I get no error and no

How to align left html_document rendered by rmarkdown?

别来无恙 提交于 2019-12-12 04:58:57
问题 Since I am not familiar with css I was wondering if there is a simple way to "tell" my rmarkdown page to left align when rendering an HTML-page? Something like this: --- title: "My html-page" output: html_document: body_placement: left --- 回答1: Maybe something like this: --- title: "My html-page" output: html_document --- <style> body { position: absolute; left: 0px;} </style> 回答2: If you'd actually like some basic styles (i.e. not my theme:null suggestion), grab Skeleton and put normalize

R read.csv from URL error in knitr

最后都变了- 提交于 2019-12-12 04:55:33
问题 When I run this code in the R console, it works fine: read.csv('https://courses.edx.org/c4x/MITx/15.071x_2/asset/WHO.csv') But when I try to put in into an R markdown document and knit it, I get the following: Error in open.connection(file, "rt") : cannot open the connection Calls: <Anonymous> ... eval -> read.csv -> read.table -> open -> open.connection Execution halted I also tried using http and url() , but neither helped read.csv('http://courses.edx.org/c4x/MITx/15.071x_2/asset/WHO.csv')

not found Calls: <Anonymous> error when knitting from r studio to HTML

北城以北 提交于 2019-12-12 04:13:42
问题 {r,eval=F} corfit <- duplicateCorrelation(brain.rma, design.trt, block = blocks) {r histOfcorrelations} print(cor) {r} plot(hist(tanh(corfit$atanh.correlations))) My codes run just fine in the RMD file, but will not knit to HTML. Error in hist(tanh(corfit$atanh.correlations)) : object 'corfit' not found Calls: ... withCallingHandlers -> withVisible -> eval -> eval -> plot -> hist Execution halted Any suggestions? Thanks! 回答1: I think that it might be because your statement eval=F. This in

making a two column text block in ms-word with knitr

余生颓废 提交于 2019-12-12 02:58:58
问题 I'm trying to recreate an existing letter, for bulk generation. I'm using knitr and a reference document in the YAML for styling of the output doc. The whole thing has gone pretty well, except for the two column address block. I have tried kable, pasting the strings with \t tabs between, and playing with the formatting of the reference doc. No dice. This is the output I want (obviously without the underscores...) : Date Client: Foo & Bar____________________ Client's Client: Bar Address: 1234