recoverDataFromPoints: recoverDataFromPoints

Description Usage Arguments Details Examples

Description

The function recovers data from a plot given the calibration points and data points.

Usage

1
2
recoverDataFromPoints(calibrationPoints, dataPoints, xmin, xmax, ymin, ymax,
  roundValue = 2, xValueName = "x", yValueName = "y")

Arguments

calibrationPoints

a list of calibration points as a list of x coordinates and another list with y coordinates. The points are in the order of ymax, ymin, xmax, xmin

dataPoints

a list of data points as a list of x coordinates and another list with y coordinates.

xmin

The minimum on the x axis of an extraction plot

xmax

The maximum on the x axis of an extraction plot

ymin

The minimum on the y axis of an extraction plot

ymax

The maximum on the y axis of an extraction plot

roundValue

The number of decimal points to round data.

xValueName

The name of the x value in the returned dataset

yValueName

The name of the y value in the returned dataset

Details

It is assumed the figure is rotated such that the x and y axis are in the cardinal directions. A distorted or rotated image should be processed with image editing software before a recovery is attempted.

The extractCalibrationPoints() function can aquire the calibration points. The extractDataPoints() function can aquire the data points.

This function is designed to work on a single dataset. If multiple datasets are in the software then this function should be called multiple times.

This function assumes min is on left and max is on right. This function assumes the value goes from the minimum on the bottom to the maximum on the top.

Examples

1
2
3
4
5
6
7
prepareExtractionPlot("figure_7_Rogers_Commission_1986.png")
calibrationPoints <- extractCalibrationPoints()
datapoints <- extractDataPoints(24)

dataValues <- recoverDataFromDatePoints(calibrationPoints,
   datapoints, beginDate, endDate, ymin, ymax
)

Agriculturist/SimpleDigitizeR documentation built on July 28, 2020, 4:22 a.m.