I have to generate a rmarkdown(html) for each row in a csv file.
Each html must contain:
- One image
- one plot highlighting the area
- one plot illustrating areas distribution.
I just made this for one row.
My csv test file looks like this:
classe nota nome area
1 10 TA 10
2 2 TB 20
3 3 TC 30
4 4 TD 15
4 6 TE 15
However, I would like to generate one html for each row in my table.
Does anyone knows how to generate this loop?
The code I used to build this HTML is:

{r label, echo=FALSE, message=FALSE}
setwd("D:/IDGeo/Earth analytics course_Learn data science/week 1")
library(knitr)
library(tidyverse)
library(gghighlight)
library(dplyr)
library(plotly)
theme_set(theme_bw())
tabela<-read.csv2("p1.csv", h=TRUE, dec=",")
#Definning mean values for x and y
x_mid<- mean(tabela$nota, na.rm = TRUE)
y_mid<- mean(tabela$classe, na.rm = TRUE)
#Graph with highlighted point
df<-tabela %>% mutate(name = row.names(.))
df %>%
mutate(quadrant = case_when(nota > x_mid & classe > y_mid ~ "Q1",
nota <= x_mid & classe > y_mid ~ "Q2",
nota <= x_mid & classe <= y_mid ~ "Q3",
TRUE ~ "Q4")) %>%
#df %>%
ggplot(aes(nota,classe)) +
geom_point(col="darkred") +
gghighlight(nota == 2,
unhighlighted_colour = alpha("steelblue", 0.4),
use_direct_label = TRUE,
label_key = nome,
label_params = list(size = 5)) +
geom_vline(xintercept = x_mid) +
geom_hline(yintercept = y_mid) +
geom_point(col="darkred", sixe = 2.5)
#General areas graph
x <- c(tabela$classe)
y <- c(tabela$area)
data <- data.frame(x, y)
barra <- plot_ly(data, x = ~x, y = ~y, type = 'bar', color = I("black")) %>%
layout(title = "Features",
xaxis = list(title = ""),
yaxis = list(title = ""))
barra