I've kml file exported from Google Earth Pro, consist of 37 Folder, each Folder contain number of "minor" Folder, the number of total "minor" Folders is 168, each "minor" has 3 placemarks.
I've HTML code, i made it with R, and want to import this kml file into R and put this HTML code into the first "Placemark" for each "minor" Folder, this HTML code isn't constant, it has variables like the values in the table in this code, and this variables will attached from dataframe i made for this "minor" Folder,when i edit this HTML code, i'll put it into the first "placemark" for this "minor" Folder, and so on for the other "minor" Folders.
is there any fuction in R that can add this html code to the kml file ?
here's the code of "description" in R.
URL <- paste("file:///C:/Users/pc/Downloads/Googletraffic/Tazbet/Autostrad;Helwan To Da2ery/",FileName,sep = "")
library(XML)
top = newXMLNode("description")
table = newXMLNode("table ", attrs = c(width = 300, border = 1), parent = top)
tbody <- newXMLNode("tbody",parent = tr)
tr <- newXMLNode("tr",parent = table)
th <- newXMLNode("th",attrs = c(scope = "col"),scope1 = max(Bey2ollak$V3),parent = tr)
th <- newXMLNode("th",attrs = c(scope = "col"),scope1 = "MD",parent = tr)
th <- newXMLNode("th",attrs = c(scope = "col"),scope1 = "PM",parent = tr)
tr <- newXMLNode("tr",parent = table)
th <- newXMLNode("th",attrs = c(scope = "col"),scope1 = max(Bey2ollak$V3),parent = tr)
th <- newXMLNode("th",attrs = c(scope = "col"),scope1 = "MD",parent = tr)
th <- newXMLNode("th",attrs = c(scope = "col"),scope1 = "PM",parent = tr)
tr <- newXMLNode("tr",parent = table)
th <- newXMLNode("th",attrs = c(scope = "col"),scope1 = max(Bey2ollak$V3),parent = tr)
th <- newXMLNode("th",attrs = c(scope = "col"),scope1 = "MD",parent = tr)
th <- newXMLNode("th",attrs = c(scope = "col"),scope1 = "PM",parent = tr)
th <- newXMLNode("img",attrs = c(src = URL,width = "700",height= "777",alt=""),parent =top )
top
here's the output in console
<description>
<table width="300" border="1">
<tr>
<th scope="col">5</th>
<th scope="col">MD</th>
<th scope="col">PM</th>
</tr>
<tr>
<th scope="col">5</th>
<th scope="col">MD</th>
<th scope="col">PM</th>
</tr>
<tr>
<th scope="col">5</th>
<th scope="col">MD</th>
<th scope="col">PM</th>
</tr>
</table >
<img src="file:///C:/Users/pc/Downloads/Googletraffic/Tazbet/Autostrad;Helwan To Da2ery/Spiral.jpg " width="700" height="777" alt=""/>
</description>
here's my kml file