I started to use ggplot in order to generate some graphs. I am using the very basic of the sample they have in their site for an “step graph”: http://had.co.nz/ggplot2/geom_step.html
I need something like the last example in that page. The issue I found is the example is in one DF and every Y has a different value in X. I have 3 sets to plot, all of them has the same X and Y values in all X. I don’t get how to produce the graphic in R. In excel I create the first line and add the other 2 as new data series but I am lost in ggplot. Any advise is really appreciated.
My plot commands are now as this (each of them with different df):
qplot(seq_along(x), x, data = df, geom="step", colour = trt)
Is there a way to have one df with all the values? Any example will be great. Thanks in advance for your time
EDIT>>>>
Here is some data to see:
head(df_nourbanas)
x trt
1 3 no urbanas
2 85 no urbanas
3 450 no urbanas
4 942 no urbanas
5 1362 no urbanas
6 1699 no urbanas
head(df_urbanas)
x trt
1 65 urbanas
2 1019 urbanas
3 2192 urbanas
4 3164 urbanas
5 3847 urbanas
6 4338 urbanas
head(df_todas)
x trt
1 3 todas
2 152 todas
3 1481 todas
4 3158 todas
5 4564 todas
6 5593 todas
And this is what I need to have (this is in excel) directly form R using the steps mode

You are having problems because you are using implicit information in the data set: the order the points are, which becomes the x-axis position. Make this explicit and things become easier.
Now these 3 data sets can be combined.
and plotting them is just