Package 'digitize'

Title: Use Data from Published Plots in R
Description: Import data from a digital image; it requires user input for calibration and to locate the data points. The end result is similar to 'DataThief' and other other programs that 'digitize' published plots or graphs.
Authors: Timothée Poisot [aut], Rene Sachse [aut], Jaime Ashander [aut, cre], Tal Galili [aut]
Maintainer: Jaime Ashander <[email protected]>
License: GPL (>= 2)
Version: 0.0.4
Built: 2025-02-05 03:24:49 UTC
Source: https://github.com/tpoisot/digitize

Help Index


digitize : a plot digitizer in R

Description

Get data from a graph by providing calibration points

Details

The package provides one main function, digitize, which runs functions that 1) Read the image in and calibrate it, and 2) Digitize the data. The first step requires user input.


(deprecated) Digitize the data

Description

(deprecated) Digitize the data

Usage

Calibrate(data, calpoints, x1, x2, y1, y2)

Arguments

data

output of 'DigitData'

calpoints

output of 'ReadAndCal'

x1

X-coordinate of the leftmost x point (corrected)

x2

X-coordinate of the rightmost x point (corrected)

y1

Y-coordinate of the lower y point (corrected)

y2

Y-coordinate of the upper y point (corrected)

Details

deprecated, use digitize instead. This function corrects the data according to the calibration information. Usage further explained at http://lukemiller.org/index.php/2011/06/digitizing-data-from-old-plots-using-digitize/

Value

'data' A data frame with the corrected coordinates of the points

Examples

## Not run: Calibrate(data,calpoints,x1,x2,y1,y2)

(deprecated) Mark the data on an image

Description

(deprecated) Mark the data on an image

Usage

DigitData(col = "red", type = "p", ...)

Arguments

col

color of marker as in 'par'

type

shape of marker as in 'par'

...

other args for 'locator'

Details

deprecated, use digitize instead. This function waits for the user to click the points of the coordinates. See 'graphics::locator' for more. Usage explained at http://lukemiller.org/index.php/2011/06/digitizing-data-from-old-plots-using-digitize/

Value

'data' A list with the coordinates of the points


digitize an image

Description

digitize an image

Usage

digitize(image_filename, ..., x1, x2, y1, y2)

Arguments

image_filename

the image file you wish to digitze

...

pass parameters col or type to change data calibration points

x1

(optional) left-most x-axis point

x2

(optional) right-most axis point

y1

(optional) the lower y-axis point

y2

(optional) the upper y-axis point

Details

Proceeds in two steps, both of which require user input from the mouse:

1) Read the image in and calibrate it

2) Digitize the data

Calibration points are optionally passed via arguments x1, x2, y1, y2. These **must be named in full** if passed.

If not specified, you are prompted to enter these in the console. Note, you don’t need to choose the end points of each axis, only two points for which you know the x or y return.

Value

a data.frame containing the digitized data

Examples

## Not run: 
tmp <- tempfile()
png(tmp)
plot(rnorm(10) + 1:10, xlab="x", ylab="y")
dev.off()

mydata <- digitize(tmp)

## End(Not run)

(deprecated) Read image and calibrate

Description

(deprecated) Read image and calibrate

Usage

ReadAndCal(fname)

Arguments

fname

Filename of the graphic to read

Details

deprecated, use digitize instead. Called for side effect of user locating points. See 'graphics::locator' for more. Usage explained at http://lukemiller.org/index.php/2011/06/digitizing-data-from-old-plots-using-digitize/

Value

'calpoints' List of the x and y coordinates of the calibration points

Examples

## Not run: ReadAndCal(fname)