I am new to R, and I am working on graphing data that is spread out over the years 1963-2014. In my data, I have one column for the year (year), another for a month (month), and another for the concentration of magnesium in the water (Mg).
I am trying to make a scatter plot of how magnesium concentration has changed over time, but if I plot years on the x-axis and magnesium on the y, I end up with 12 points (one for each month) stacked on top of each other for every year. My data is called water2, and it produces this graph.
Is there a way to ask R to spread these magnesium points out over the months and the years, essentially using two columns to define 1 x-axis? Alternatively, is there a way to create a new column that will define the years and months in one?
pasteis a good way to stick two strings together. Alternatively you could use an actualDateclass and set the dates to, e.g., the first day of each month. - Gregor Thomas