# NOT RUN {
library(xml2)
doc = as_xml_document(response_matrix)
extract_matrix(doc, value = "distance_m")
extract_matrix(doc, value = "distance_text")
extract_matrix(doc, value = "duration_s")
extract_matrix(doc, value = "duration_text")
# }
# NOT RUN {
locations = c("Haifa", "Tel-Aviv", "Jerusalem", "Beer-Sheva")
doc = google_matrix(
origins = locations,
destinations = locations
)
extract_matrix(doc, value = "distance_m")
extract_matrix(doc, value = "distance_text")
extract_matrix(doc, value = "duration_s")
extract_matrix(doc, value = "duration_text")
# }
Run the code above in your browser using DataLab