graph.extract: Extract raw data from graphs

Description Usage Arguments Details Note References

View source: R/graph.extract.R

Description

Extract data values from existing graphs in jpeg format.

Usage

1
graph.extract(MT, refX, refY, save = "no", image = read.jpeg(file.choose()))

Arguments

MT

Measurement times: number of observations

refX

2 reference values for the X scale (e.g., refX=c(2,14)).

refY

2 reference values for the Y scale (e.g., refY=c(10,16)).

save

Save the extracted data points to a file (save="yes") or just see them as output in the R console (default: save="no").

image

Jpeg file in which the graph can be found. Default: a window pops up in which the file can be selected.

Details

When using the default image argument, a window will pop up to ask in what jpeg file the graph can be found.

Then the reference values should be located on the graph by clicking with the left mouse button: first the X values and then the Y values. The marked reference points are indicated with a blue cross.

Then each data point should be located sequentially. The marked data points are indicated with a red circle.

When finished, the calibrated true data points are displayed as output in the R console and plotted in a new graph, as a quick visual check.

When choosing to save these data values to a file (save="yes"), another window will pop up to ask where to save them. Here one can creat a new txt file in the folder of choice.

Note

This function is an adaptation of: Timothee. (2010, March 5). Data visualization (in R). Getting data from an image (introductory post). [Web log message]. Retrieved from http://rdataviz.wordpress.com/2010/03/05/getting-data-from-an-image-introductory-post/.

We would like to thank David Howell for pointing us to this function.

The function based on functions adopted from the ReadImages package, which has been orphaned and archived by CRAN.

References

Bulte, I., & Onghena, P. (2012). When the truth hits you between the eyes: A software tool for the visual analysis of single-case experimental data. Methodology, 8, 104-114.

http://ppw.kuleuven.be/home/english/research/mesrg


SCVA documentation built on Jan. 10, 2020, 1:06 a.m.