title: Plotting multiple variables and factor with different colors and line type in R
body: <p>I have a code to plot multiple variables and factor in ggplot.
  I wanted to change the lines type from siple line to something like dash or dot to better presentation of variables.
  Moreover, now they are presented by different colors.</p>
  
  <p>Code:</p>
  
  <pre><code>df &lt;- data.frame(z25$avg,z28$avg,z29$avg,z31$avg,z32$avg,sdtt$dt,znode25$outside)
  names(df) &lt;-  c("Node 25","Node 28","Node 29","Node 31","Node 32","Time_Date", "Results")
  df.m &lt;- melt(df, names(df)[6:7], names(df)[1:5])
  df.m$Results &lt;- factor(df.m$Results)
  df.m$Time_Date &lt;- strptime(as.character(df.m$Time_Date), format = "%Y-%m-%d %H:%M:%S")
  p &lt;- ggplot(df.m, aes(x = Time_Date, y = value, group = variable, color = variable))
  p &lt;- p + geom_point(aes(shape = Results), cex=3)
  p &lt;- p + scale_shape_manual(values=c(15,2))
  p &lt;- p + geom_line()
  p &lt;- p + theme(axis.text.x = element_text(angle = 90, hjust = 1))
  p &lt;- p + scale_color_manual(values=c("#000099","red","green",'blue',"yellow"))
  p &lt;- p + ylim(-1,8)
  p &lt;- p + xlab('Date and Time') 
  p &lt;- p + ylab('Temprature') 
  p &lt;- p + ggtitle("Spatial Outliers of Node 25 ") + theme(plot.title = element_text(lineheight=3, face="bold", color="black"))
  p
  </code></pre>
  
  <p>Plot:
  <img src="https://i.stack.imgur.com/M5Iw3.png" alt="enter image description here"></p>
  
  <p>Sample data df.m:</p>
  
  <pre><code>            Time_Date Results variable       value
  1 2007-09-30 01:00:00       1  Node 25 -0.35333333
  2 2007-09-30 02:00:00       1  Node 25 -0.42333333
  3 2007-09-30 03:00:00       1  Node 25 -0.73333333
  4 2007-09-30 04:00:00       1  Node 25 -0.65000000
  5 2007-09-30 05:00:00       1  Node 25 -0.40000000
  6 2007-09-30 06:00:00       1  Node 25 -0.09166667
  </code></pre>
  
  <p>sample data df:</p>
  
  <pre><code>      Node 25     Node 28   Node 29    Node 31     Node 32           Time_Date Results
  1 -0.35333333 -0.21000000 0.1433333 -0.3533333 -0.19833333 2007-09-30 01:00:00       1
  2 -0.42333333 -0.37500000 0.2783333 -0.4850000 -0.25000000 2007-09-30 02:00:00       1
  3 -0.73333333 -0.62166667 0.2466667 -0.7650000 -0.56500000 2007-09-30 03:00:00       1
  4 -0.65000000 -0.58833333 0.3400000 -0.7150000 -0.45166667 2007-09-30 04:00:00       1
  5 -0.40000000 -0.34333333 0.5900000 -0.4666667 -0.21333333 2007-09-30 05:00:00       1
  6 -0.09166667 -0.02666667 0.8400000 -0.1666667  0.09666667 2007-09-30 06:00:00       1
  </code></pre>