title: Multiple plots using ggplot: Error in printing plot
body: <p>In trying to answer this question:</p>
  
  <blockquote>
    <p>Compare emissions from motor vehicle sources in Baltimore City with emissions from motor vehicle sources in Los Angeles County, California (<code>fips == "06037"</code>). Which city has seen greater changes over time in motor vehicle emissions?</p>
  </blockquote>
  
  <p>I am able to answer the query but not able to create legends using ggplot:</p>
  
  <pre><code>#load library
  library(data.table)
  library(ggplot2)
  
  #import rds files
  NEI &lt;- readRDS("summarySCC_PM25.rds")
  SCC &lt;- readRDS("Source_Classification_Code.rds")
  
  #convert to data tables
  NEI.DT &lt;- data.table(NEI)
  SCC.DT &lt;- data.table(SCC)
  
  #Get data for Baltimore
  NEI.DT.Baltimore &lt;- NEI.DT[fips=="24510", ]
  NEI.DT.LA &lt;- NEI.DT[fips=="06037", ]
  
  #Check for Motor &amp; Vehicle in SCC data using EI.Sector
  motorVehicelSrcs &lt;- SCC.DT[grep("[Mm]obile | [Vv]ehicles",  EI.Sector),   SCC]
  emissionsBaltimore &lt;- NEI.DT.Baltimore[SCC %in% motorVehicelSrcs,    sum(Emissions), by="year"]
  emissionsLA &lt;- NEI.DT.LA[SCC %in% motorVehicelSrcs, sum(Emissions), by="year"]
  
  View(emissionsBaltimore)
  View(emissionsLA)
  
  setnames(emissionsBaltimore , "V1" , "Emissions") 
  setnames(emissionsLA , "V1" , "Emissions") 
  
  #plot data
  plot_x &lt;- ggplot(emissionsBaltimore, aes(year, Emissions)) +     geom_line(aes(data=emissionsBaltimore, x=year, y= Emissions, colour = "MyLine1")) + geom_point(colour = "blue") + geom_line(aes(data = emissionsLA, x= year, y= Emissions, colour = "MyLine2")) + geom_point(data= emissionsLA, colour = "black") + scale_colour_manual(name="Line Color", values=c(MyLine1="green", MyLine2="red"))
  print(plot_x)
  </code></pre>
  
  <p>I am getting the following error:</p>
  
  <pre><code>Error: "Don't know how to automatically pick scale for object of type data.table/data.frame. Defaulting to continuous
  Error: Aesthetics must either be length one, or the same length as the dataProblems:emissionsBaltimore"
  </code></pre>
  
  <p>Can someone help in resolving the error?</p>
  
  <p>The data for the above code is available at: <a href="https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2FNEI_data.zip" rel="nofollow">https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2FNEI_data.zip</a></p>