title: ggplot 2 "Error: Discrete value supplied to continuous scale"
body: <p>I would like to ask how to fix this bug described in question title? Just yesterday, the code was working fine and the plotting routine produced the desired graph. Woke up today and tried to add some features and then got the error message.</p>
  
  <p>Any clue as why and how to fix this?</p>
  
  <p>Thx</p>
  
  <p>Data link:
  <a href="https://www.dropbox.com/s/hujiacus8ek5o5z/MoroccoCGE-CC_Stats.csv" rel="noreferrer">Data.csv</a></p>
  
  <p>code:</p>
  
  <pre><code>    # Loading data
      morStats &lt;- read.csv(file = "F:/Purdue University/RA_Position/PhD_ResearchandDissert/PhD_Draft/DissertationDraft/MoroccoCGE-CC_Stats.csv", header=TRUE, sep=",", na.string="NA", dec=".", strip.white=TRUE)
  
      # Transferring the .csv data into data frames
      moroccostats &lt;- as.data.frame(morStats)
  
      # Changing the data in the dataframe to "as.numeric"
      moroccostats[3:38] &lt;- sapply(moroccostats[3:38],as.numeric)
      moroccostats &lt;- droplevels(moroccostats)
  
      # reorder 
      moroccostats &lt;- transform(moroccostats,year=factor(year,levels=unique(year)))
  
      # Load packages
      library(reshape2)
      library(ggplot2)
      library(lattice)
      library(grid)
      library(plyr)
      library(gridExtra)
      library(scales)
  
      #----------------------------------------------------------------------
      # Figure 1: Evolution of population (in absolute terms) 1960-2050
      #---------------------------------------------------------------------
  
      #_Code_Begin...
  
      moroccostats.f &lt;- melt(moroccostats, id="year")
      morstats.pop &lt;- moroccostats.f[moroccostats.f$variable %in% c("pop_t","pop_ur","pop_ru"),]
  
      Figure1 &lt;- ggplot(data=morstats.pop,aes(x=factor(year), y=value,colour=variable))
      Figure1 + geom_line(aes(group=factor(variable)),size=1) + geom_point() + scale_colour_manual("Population",labels=c("Total","Urban","Rural"),values = c("black","red","blue")) +
      labs(y="Population (in 1000)") + 
      theme(axis.text.x = element_text(colour = 'black', angle = 90, size = 13, hjust = 1, vjust = 0.5),axis.title.x = element_blank()) + 
      theme(axis.text.y = element_text(colour = 'black', size = 13, hjust = 0.5, vjust = 0.5), axis.title.y = element_text(size = 10, hjust = 0.5, vjust = 0.2, face = 'bold')) +
      scale_x_discrete(breaks = seq(1960, 2050, by=2)) +
      scale_y_continuous(breaks = seq(0, 42000, by=5000))
  
      #_Code_End...
  </code></pre>