I would like to import images such as this
, so that i can plot another graph over the image as described here and here.
the problem I am having is the graph is not a graphical object with a fixed url, but rather, created by code. I don’t really understand the code behind the image, but have been unable to scrape recreate it using RCurl and XML.
I see two possible options: using R to launch a browser and save image as
or processing properly the code, I imagine somehow like this
URL<-"http://
test<-htmlParese(getURL(url))
xpathSApply(
any thoughts?
The link to the image you want to scrape is not an “xml image”. It is simply a .png file. So, it suffices to save the image to a file, load it into R, and then put it on the plot. Something like this will get you there, but you’ll need to play with it a bit to make it pretty.