title: Two datasets rescaled and combined into one
body: <p>I need to rescale two sets of variables: 1 that goes from -2.5 to 2.5 and another one that goes from 0 to 1 into 1:10 with set mean and SD (common) mean = 2 and SD = 4.5 using R. Can anything help? Thanks in advance!</p>
  
  <p>I tried simple scale(x) formula to get z-score and then rescale(x) formula setting the new scale 1:10. However, I can't find a way to set the mean and SD to common values in rescaling, so the two datasets are comparable. </p>
  
  <pre><code>attach (WGI)
  summary (WGI$PV_1996)
  Vector1 &lt;- c(WGI$PV_1996)
  x&lt;- Vector1
  
  scale(x)
  
  rescale&lt;- function(x)(x-min(x))/(max(x)-min(x)) *10
  rescale (scale(x))
  sd (scale(x))
  summary (scale(x))
  dataout &lt;-rescale(x)
  print(dataout)
  
  write.csv(dataout, file="RescaledWGI_1996.csv")
  </code></pre>
  
  <p>Expected outcome: combined dataset that includes two rescaled original datasets.</p>