Hi Teresa Try this:
Median <- 4.3 Mean <- 4.2 SD <- 1.8 RangeLower <- 0 RangeUpper <- 8 par(mfcol = c(1,2)) (bpstats <- boxplot(rnorm(100, mean = Mean, sd = SD), outl = FALSE)) ## assuming normality of original data since we don't know the distribution ## get the 25% and 75% quantile q25 <- qnorm(0.25, mean = Mean, sd = SD) q75 <- qnorm(0.75, mean = Mean, sd = SD) yourstats <- matrix(c(RangeLower, q25, Median, q75, RangeUpper), ncol = 1) bpstats$stats <- yourstats bxp(bpstats, outl = FALSE) Yours sincerely / Med venlig hilsen Frede Aakmann Tøgersen Specialist, M.Sc., Ph.D. Plant Performance & Modeling Technology & Service Solutions T +45 9730 5135 M +45 2547 6050 fr...@vestas.com http://www.vestas.com Company reg. name: Vestas Wind Systems A/S This e-mail is subject to our e-mail disclaimer statement. Please refer to www.vestas.com/legal/notice If you have received this e-mail in error please contact the sender. > -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Mª Teresa Martinez Soriano > Sent: 4. april 2014 10:49 > To: r-help@r-project.org > Subject: [R] Simulating data > > Hi to everyone > > > To simulate data I only know this command: > > rnorm(n , mean, sd) > > It exists another way to specify Median and range as well? > > The point is that I have this information about the variable: > > > Median: 4.3 > Mean: 4.2 > SD: 1.8 > Range: 0-8 > > and I need a boxplot, but I don't have the original data, simulating data > looks a good idea to solve it. > > Thanks in advance. > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.