WebPlotDigitizer powered R package for data extraction from images of plots, maps etc.
This package is under heavy development, but uses a stable version of WebPlotDigitizer. If you want to give this a try, then follow these instructions:
-
If you don't already have devtools, then install using:
install.packages("devtools")
-
Install digitizeR (Linux/Mac/Windows):
devtools::install_github("ankitrohatgi/digitizeR")
No real-time communication has been implemented at the moment, but you can launch and close WPD using the following:
Load library:
library('digitizeR')
Launch a local instance of WebPlotDigitizer:
app <- wpd_launch()
This starts a httpuv based server on your machine. This should also open the local URL in a browser window.
Close server instance:
wpd_close(app)
Change default server location and port:
app <- wpd_launch(location="192.168.1.100", port=8080) # for example
At the moment, this package only lets you start (and stop) WebPlotDigitizer, but eventually, I would like to add R functions that can communicate with the app in real-time (using WebSockets). A few examples of what is possible in the future are as follows:
ds <- wpd_getDatasets(app) # fetch all digitized data as a data frame.
wpd_loadImage(app, 'my_plot.jpg') # load an image file programmatically.
wpd_loadPDF(app, 'thesis.pdf', page=5) # load a specific page from a PDF file.
wpd_calibrate(app, 'calibration_data.json') # align the axes to pixels using some calibration data.
# and so on.
Ankit Rohatgi [email protected]