title: Error in customizing the x axis with scale_x_discrete() in ggplot2
body: <p>I have the following figure:
  <a href="https://i.stack.imgur.com/5ndNZ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5ndNZ.jpg" alt="enter image description here"></a></p>
  
  <p>That came from this working piece of code:</p>
  
  <pre><code>ggplot(plot, aes(x=variable, y=value, colour=Species, group=Species)) + geom_line() +
    geom_point() + facet_grid(. ~ Treatment) + theme_bw() +
    theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5), panel.grid.major = element_blank(),
          panel.grid.minor = element_blank(), axis.title.y = element_blank(),
          legend.text = element_text(face = "italic"), legend.key = element_blank(),legend.title=element_blank(),
          legend.position="bottom", legend.background = element_rect(colour = 'black')) 
  </code></pre>
  
  <p>However I would like to remove some of the YEARS in the x axis. I tried to add this piece of code to the theme(...), which should do the trick, but it did not work:</p>
  
  <pre><code>scale_x_discrete(breaks = c("1993","1994","1995","1996","1998","2000","2003","2006","2014"))
  </code></pre>
  
  <p>R returns the following error which I don't understand:</p>
  
  <pre><code>Error in (function (el, elname)  : "" is not a valid theme element name.
  </code></pre>
  
  <p>This is the str() of my data:</p>
  
  <pre><code>str(plot)
  'data.frame':   616 obs. of  4 variables:
   $ Species  : Factor w/ 290 levels "Abarema jupunba",..: 21 24 32 48 54 60 62 81 117 139 ...
   $ Treatment: chr  "Conventional logging" "Conventional logging" "Conventional logging" "Conventional logging" ...
   $ variable : Factor w/ 22 levels "1993","1994",..: 1 1 1 1 1 1 1 1 1 1 ...
   $ value    : num  1.34808 0.62532 0.20571 2.69961 0.00427 ...
  </code></pre>
  
  <p>Not sure if the information I provided is enough but I wonder if anyone has an idea why this is not working?</p>