I am trying to convert my xml data to a data frame in order to export it as a csv. The XML data is below. When I use the code finalresults <- xmlToDataFrame(results), all of the data is put into one cell under the element column. Does anyone know how I can parse this data out? What I really need is the 20495 number under duration_in_traffic. Thank you!
> xmlChildren(results$row[[1L]])
$status
<status>OK</status>
$duration
<duration>
<value>20231</value>
<text>5 hours 37 mins</text>
</duration>
$distance
<distance>
<value>459266</value>
<text>459 km</text>
</distance>
$duration_in_traffic
<duration_in_traffic>
<value>20495</value>
<text>5 hours 42 mins</text>
</duration_in_traffic>
attr(,"class")
[1] "XMLInternalNodeList" "XMLNodeList"