How to move objects /images in RMarkdown?

Viewed 295

I discovered this RMarkdown document in this video and I am wondering how the creator of this Markdown document was able to shift the pear images to the left while maintaining the text on the left side of the document. From my understanding this requires understanding some HTML to move these objects. I know a little know understand this but not enough to implement this. Would anyone have any ideas on how to do something like this?

The main reason I want to do something like this is because I want to create a dashboard style RMarkdown document (not using Flexdashboard or Shiny, strictly Markdown)

Desired Output of a document: In short, how did the author get the image of this peach on the left side of this document?

enter image description here

1 Answers

The main thing that was done in the Code for the video was:

<div style="float:right; margin-left: 40px;">
</div>

Which inside the div had the image that was floated right in HTML

I tried to give you a basic replica of your image. This is why I love Rmarkdown, it is so diverse and powerful. I am not sure exactly what graphing library is used, I used plotly and it was just output: html_document file.

enter image description here

---
title: "Untitled"
output: html_document
---

<div style="float:right; margin-left: 40px;">
```{r out.width="600px",echo=FALSE, message=FALSE, warning=FALSE}
library(knitr)
include_graphics('https://purepng.com/public/uploads/large/purepng.    com-red-appleapplemalus-domesticafruitdeliciousred-apple-1701527164    92043huf.png')
```
</div>

# scientific
([**scientific**]() |
[**scientific**]() |
[**scientific**]())

*Date:* 01-01-1999

**name:** Tim Jackson <br>
**company:** Investing Inc. <br>
**example:** June 2021 report

This is a paragraph. This is a paragraph. This is a paragraph. This     is a paragraph. This is a paragraph. This is a paragraph. This is a     paragraph. This is a paragraph. This is a paragraph. This is a     paragraph. This is a paragraph. This is a paragraph. This is a     paragraph. This is a paragraph. This is a paragraph. This is a     paragraph. This is a paragraph. This is a paragraph.

```{r out.width="300px",echo=FALSE,warning=FALSE,message=FALSE}

library(plotly)

trace_0 <- rnorm(100, mean = 5)
trace_1 <- rnorm(100, mean = 0)
trace_2 <- rnorm(100, mean = -5)
x <- c(1:100)

data <- data.frame(x, trace_0, trace_1, trace_2)

fig <- plot_ly(data, x = ~x) 
fig %>% add_trace(y = ~trace_0, name = 'trace 0',mode = 'lines') 

```
Related