Let $X$ be a normally-distributed random variable. How can I transform this $X \in \mathbb{R}$ into another r.v. $Y \in [0; 1]$ whilst maintaining its normal-like shape?
One common way of performing a one-to-one transformation from $\mathbb{R}$ into $[0; 1]$ is to calculate the CDF of the original variable. The "problem" with that approach is that the result will be uniformly-distributed. This is a well-known property, but here is an example to illustrate:
set.seed(2345)
x <- rnorm(1000)
hist(x)
y <- pnorm(x)
hist(y)
The histograms of $x$ and $y$ will look like this:

However, as I mentioned, I would like to transform $X \in \mathbb{R}$ into $Y \in [0; 1]$ and have $Y$ bell-shaped?

qnormon the runif, but that will only get you the original variable... – juod Feb 27 '17 at 10:08(x - min(x))/(max(x) - min(x))? – Francis Feb 27 '17 at 10:41{x - min(x)} / {max(x) - min(x)}to transform $x \in (-\infty, \infty)$ into $(0, 1)$. In my application, I've actually usedmin - IQRandmax + IQRinstead ofminandmaxso I could have values a bit more concentrated around 0.5. – Waldir Leoncio Feb 28 '17 at 10:33res=replicate(10000,{x=rnorm(6);(x-min(x))/(max(x)-min(x))});hist(res,n=50)to see what it does to samples of size 6. – Glen_b Feb 28 '17 at 11:14hist(replicate(10000,scale(rnorm(4))),n=50)– Glen_b Feb 28 '17 at 11:20