When generating random numbers in R using rnorm (or runif etc.), they seldom have the exact mean and SD as the distribution they are sampled from.
rnorm
runif
Since you asked for a one-liner:
rnorm2 <- function(n,mean,sd) { mean+sd*scale(rnorm(n)) } r <- rnorm2(100,4,1) mean(r) ## 4 sd(r) ## 1