This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
wiki:guide:tips:digitize [2022/02/09 19:16] nicole_hardy_alumni.brown.edu |
wiki:guide:tips:digitize [2022/02/09 21:13] (current) nicole_hardy_alumni.brown.edu |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Extracting Data from Images ====== | ====== Extracting Data from Images ====== | ||
- | Have you ever read a paper and realized that the data you need is in a figure, but you can't pull the exact number from it? Have no fear! You can actually digitize these figures to extract the data you need. | + | Have you ever read a paper and realized that the data you need is in a figure, but you can't pull the exact number from it? Have no fear! You can actually digitize these figures to extract the data you need. |
- | <WRAP center round alert 60%> | + | ===== Prerequisites ===== |
- | R, RStudio, and the digitize package need to be installed beforehand. See [[https:// | + | |
- | </ | + | R, RStudio, and the digitize package need to be installed beforehand. See [[https:// |
===== Steps ===== | ===== Steps ===== | ||
- | | + | |
- | - Save as high resolution | + | |
+ | - Load the digitize | ||
+ | - Type in digitize(" | ||
+ | - Once you do this, you will need to calibrate your x and y axes, respectively. | ||
+ | - On the x axis, select two clearly defined points where you have the exact values. Tick marks on the x axis would be great choices. | ||
+ | - On the y axis, select two clearly defined points where you have the exact values. Tick marks on the y axis would be great choices. | ||
+ | - Once you finish, you will see blue X's at the points you selected. {{ : | ||
+ | - Type each of the points you selected in the console, hitting enter after each one. In the example above, you would do the following: 0, enter, 24, enter, 8.5, enter, 12, enter. | ||
+ | - Click on all the data points you want the (x,y) values for, and click finish in the plot or hit ESC on your keyboard. You will see red circles over the points you selected. | ||
+ | - {{ : | ||
+ | |||
+ | <WRAP center round tip 90%> Always double check to make sure the values that R gives you align with what you're expecting. </ | ||
+ | |||
+ | ===== Video Walk Through: ===== | ||
+ | Check out this video! If it's blurry, go directly to the YouTube page to view it. {{youtube> | ||
+ | |||
+ | ===== R Script: ===== | ||
+ | < | ||
+ | # | ||
+ | ### Setting up workspace to be able to digitze graphs | ||
+ | # | ||
+ | setwd(" | ||
+ | install.packages(' | ||
+ | library(' | ||
+ | |||
+ | digitize(" | ||
+ | |||
+ | </ |