title: R manually set shape by factor
body: <p>Asked this question the other day but no one could visualize my question so ive made an example.    </p>
  
  <pre><code>A &lt;- c('a','b', 'c','d','e')
  types &lt;- factor(A)
  B &lt;- c(1,2,3,4,5)
  C &lt;- c(6,7,8,9,10)
  D &lt;- c(1,2,1,2,3)
  ABC &lt;- data.frame(B,C,D,types)
  
  library(ggplot2)
  
  ggplot(ABC, aes(x=B ,y=C ,size=D, colour=as.factor(types),label=types, shape=as.factor(types))) +
  geom_point()+geom_text(size=2, hjust=0,colour="black", vjust=0) +
  scale_size_area(max_size=20, "D", breaks=c(100,500,1000,3000,5000))  +
  scale_x_log10(lim=c(0.05,10),breaks=c(0.1,1,10))+ scale_y_continuous(lim=c(0,30000000)) +
  scale_shape_manual(values=c(15,18,16,17,19))`
  </code></pre>
  
  <p>Plotting this you will there are factors a-e that have colours and shapes attributed to them.</p>
  
  <p>In my code I use scale_shape_manual to set the shapes and they are definded by sequence ie the order of factors is a,b,c,d,e and my values are 15,18,16,17,19 so a=15 (a square), b=18 etc etc</p>
  
  <p>I would like to set these shapes by factor. My data will be changing each day and the factors will be in different orders but I always want the same factors to have the same shapes.</p>
  
  <p>So obviously this code doesnt work but something like:</p>
  
  <p><code>scale_shape_manual(values=('a'=15, 'b'=18, 'c'=16, 'd'=17, 'e'=19))</code></p>
  
  <p>Would be helpful if I could do the same for colour too.</p>
  
  <p>Thanks</p>