I have the data in two files. I want to plot a graph the ratio of their frequencies.
For example, in my file A numbers from 1 to 5 occurs 20 times. In my file B, numbers from 1 to 5 occurs 10 times(histogram has bar width of 5). The ratio of those two is 20/10 = 2. I want to plot this ratio in a graph. Can it be done using R?
Assuming you read the 2 files in the variables
data1anddata2you could do:Alternatively you can create a 3rd hist object, which has the advantage of correctly plotting the x-axis