library(htmltools)
trial <- readLines("trial.txt")
trial consists of :
a
b
c
d
for (i in 1 : 10 ){
bus <- withTags(
div(id = i,trial[i]))
print(bus)
}
I would like the output to be :
<div id="1">a</div>
<div id="2">b</div>
<div id="3">c</div>
<div id="4">d</div>
I am gettting error : Error in trial[i] : invalid subscript type 'closure'