title: How do I generate data that have the same mean, standard deviation but very different shapes or distributions in R?
body: <p>How do I generate data that have the same mean, standard deviation but very different shapes or distributions? Below is one answer from jthetzel on how to create data with the same mean and standard deviation but I need help on how to make it non-normal. Ideally, I would like graphs of widely different shapes that share the same mean and standard deviation. </p>
  
  <pre><code>#install.packages("Runuran")
  library(Runuran)
  ## Discrete normal distribution bounded between 0 and 100
  # Create UNU.RAN discrete distribution object
  discrete &lt;- unuran.discr.new(pv = dnorm(0:100, mean = 50, sd = 25), lb = 0, ub = 100)
  
  # Create UNU.RAN object using the Guide-Table Method for Discrete Inversion
  unr &lt;- unuran.new(distr = discrete, method = "dgt")
  
  # Generate random variates from the UNU.RAN object
  d2 &lt;- ur(unr = unr, n = 1000)
  
  summary(d2)
  sd(d2)
  hist(d2)
  </code></pre>