title: Change transparency, shape and size of a categorical variables
body: <p>I am trying to plot using <code>ggplot</code> and trying to set the transparency, size and shape for <code>geom_point</code> using a binary variable in my dataset. </p>
  
  <p>For example, if <code>binary_variable == 1</code> then set the size to 1, shape = triangle, transparency = 0.2, if <code>binary_variable == 0</code> set the size to 0.5 etc.</p>
  
  <p>I have been able to make the colour change as follows:</p>
  
  <pre><code>library(ggplot2)
  
  df &lt;- data.frame(variable1 = 1:5,
                   variable2 = 1:5,
                   binary = c(0,0,0,1,1))
  
  
  ggplot(df, aes(x = variable1, y = variable2, colour = as.factor(binary))) +
    geom_point(size = 2, alpha = 0.3) +
    scale_colour_manual(values = c("grey", "black"), labels = c("cat1", "cat2")) +
    theme_bw()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/RaLVl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RaLVl.png" alt="enter image description here"></a></p>