I have data that I need to graph using R. Unfortunately, the examples I have found in books and on the web are too simplistic and do not give me much insight into the process. I have never used R before, and have been trying for hours and hours to figure out how to do what I need to do. I also already read the previous posts about R here on Ask MeFi, but I am still stumped.
I've made a fake set of data that represents the structure of my real data (which you don't want to see, it's too confusing).
Here is my sample data.
Take a quick look at that.
There is a main factor/category, Factor1 with values of "BOB" and "JILL", and a grouping within that called SubFactor with values "Q" and "P". I also have blocked reps of everything, labeled A, B, C, D. My measurements are Measurement1, Measurement2, Measurement3, etc which I will abbreviate as M1, M2, M3, etc.
To cut to the chase, I made a few hand drawings of the graphs I need. Please note that the graphs are illustrative only, and do not correspond to the data above.
Please walk me through this step-by-step and assume I know absolutely nothing about how to get my data into R, how to manipulate it as needed, and finally, how to produce the following graphs.
if any of you R graphing experts want to take me under your wing and help me learn more than I have outlined here (surely I will have future questions), please send me a MeMail.
In the first, I want to make a bar graph of just the average
of the M1 measurements for each treatment, split into categories "BOB" and "JILL" with the grouped "P" and "Q" subfactors.
So that we're on the same page here, the mean of BOB(Q) for M1 = (100+500+200+300)/4 = 275, for example.
Here is my drawing for this: Bar Graph 1
In the second, I want a plot of the measurements for "BOB", with M1, M2, M3, M4, and M5 on the X-axis. The lines will represent the "P" and "Q" subfactors.
Here is my drawing for this: Plot 1
In another bar graph, I want to have M1, M2, M3, M4, M5 be the bars, and have them grouped by BOB (Q, P) and JILL (Q, P) on the x-axis. The Y-axis would show the means.
Here is my drawing for this: Bar Graph 2
In the final plot, I want to graph only the mean measurements for "BOB" sub-level "P" over time
. Let's say that each M1, M2, M3, M4, M5 was taken at unique times T1, T2, T3, T4, T5 where the times could have values T1=15, T2=45, T3=55, T4=65, T5=70 and they need to be spaced properly on a timeline (i.e. the distance between T1 and T2 should be 30 units, T2 and T3 10 units, T3 and T4 10 units, T4 and T5 5 units) -- I spaced them evenly on the graph, so ignore that.
Here is my drawing for this: Plot 2