3

There is currently a thread for how to Wrap text around plots in Markdown but this is only for knitting to HTML. I need to be able to place text next to a plot and output to a word document.

---
title: "Untitled"
author: "Your Name"
date: "May 27, 2020"
output: word_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## R Markdown
```{r pressure, echo=FALSE, out.width= "65%", out.extra='style="float:right; padding:10px"'}
plot(pressure)
```


This is an R Markdown document. Markdown is a simple formatting syntax for authoring 
HTML, PDF, and MS Word documents. For more details on using R Markdown see 
<http://rmarkdown.rstudio.com>.

When you click the **Knit** button a document will be generated that includes both 
content as well as the output of any embedded R code chunks within the document. You can 
embed an R code chunk like this:

Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing 
of the R code that generated the plot.

Please advise.

CL.
  • 14,577
  • 5
  • 46
  • 73
  • 1
    If this is possible at all, then you will need a [reference document](https://bookdown.org/yihui/rmarkdown/word-document.html). However, even after 1) adding a figure caption to get the Word template "Captioned Figure" applied to the figure 2) modifying the "Captioned Figure" template to enable text wrapping around the figure and 3) using the modified document as reference document, I still don't get this to work … – CL. May 29 '20 at 08:09

0 Answers0