A R package to extract data from scatterplots
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
R
inst
man
tests
.Rbuildignore
.gitignore
.travis.yml
DESCRIPTION
NAMESPACE
NEWS.md
README-example-1.png
README.Rmd
README.md
cran-comments.md Remove hard wrap in cran comment Aug 27, 2016

README.md

CRAN_Status_Badge Travis-CI Build Status Codecov branch

digitize : a plot digitizer in R

Get the data from a graph by providing calibration points

Install

if(!require(devtools)) install.packages('devtools')
devtools::install_github("tpoisot/digitize")

How to use it (version 0.0.3 and up)

## make a temporary file
tmp <- tempfile()
png(tmp)
plot(rnorm(10) + 1:10, xlab="x", ylab="y")
dev.off()
#> quartz_off_screen 
#>                 2

library(digitize)

## follow instructions on console, printed out below
mydata <- digitize(tmp)
#> ...careful how you calibrate.
#> Click IN ORDER: x1, x2, y1, y2
#> 
#>     Step 1 ----> Click on x1
#>   |
#>   |
#>   |
#>   |
#>   |________x1__________________
#>    
#>     Step 2 ----> Click on x2
#>   |
#>   |
#>   |
#>   |
#>   |_____________________x2_____
#>   
#>  
#>     Step 3 ----> Click on y1
#>   |
#>   |
#>   |
#>   y1
#>   |____________________________
#>   
#>  
#>     Step 4 ----> Click on y2
#>   |
#>   y2
#>   |
#>   |
#>   |____________________________
#>   
#> 
#> What is the return of x1 ?
#> 
#> What is the return of x2 ?
#> 
#> What is the return of y1 ?
#> 
#> What is the return of y2 ?
#> 
#> 
#> 
#> ..............NOW .............
#> 
#> Click all the data. (Do not hit ESC, close the window or press any mouse key.)
#> 
#> Once you are done - exit:
#> 
#>  - Windows: right click on the plot area and choose 'Stop'!
#> 
#>  - X11: hit any mouse button other than the left one.
#> 
#>  - quartz/OS X: hit ESC
#> Error in model.frame.default(formula = c(x1, x2) ~ c(x), drop.unused.levels = TRUE): invalid type (NULL) for variable 'c(x)'

plot of chunk example

Citation

citation('digitize')
#> 
#>   Poisot, T. The digitize package: extracting numerical data from
#>   scatterplots. The R Journal 3.1 (2011): 25-26.
#> 
#> A BibTeX entry for LaTeX users is
#> 
#>   @Article{,
#>     title = {The digitize package: extracting numerical data from scatterplots},
#>     author = {T. Poisot},
#>     journal = {The R Journal},
#>     year = {2011},
#>     volume = {3},
#>     number = {1},
#>     pages = {25-26},
#>     url = {http://rjournal.github.io/archive/2011-1/RJournal_2011-1.pdf#page=25},
#>   }

Image Types

Works with three bitmap image formats (jpeg, png, bmp), automatically detecting the image type using package readbitmap.

Earlier versions

Read a tutorial from Luke Miller.