Plot with one line for each column and time-series on the x-axis R
<p>You can find my dataset <a href="https://drive.google.com/open?id=0B8clGpnMSCjUdTRXNjBNMktkdVE" rel="nofollow">here</a>.</p>

<p>From this data, I wish to plot (one line for each):</p>

<pre><code>x$y[,1]
x$y[,5]
x$y[,1]+x$y[,5]
</code></pre>

<p>Therefore, more clearly, in the end, each of the following will be represented by one line:</p>

<pre><code>y0, 
z0, 
y0+z0
</code></pre>

<p>My x-axis (time-series) will be from <code>x$t</code>.</p>

<p>I have tried the following, but the time-series variable is problematic and I cannot figure out how I can exactly plot it. My code is:</p>

<pre><code>Time &lt;- x$t
X0 &lt;- x$y[,1]
Z0 &lt;- x$y[,5]
X0.plus.Z0 &lt;- X0 + Z0
xdf0 &lt;- cbind(Time,X0,Z0,X0.plus.Z0)
xdf0.melt &lt;- melt(xdf0, id.vars="Time")

ggplot(data = xdf0.melt, aes(x=Time, y=value)) + geom_line(aes(colour=Var2))
</code></pre>