sim.data <- function(mean.x, sd.x, mean.y, sd.y)
{
	x <- round(rnorm(20, mean.x, sd.x), 4)
	y <- round(rnorm(20, mean.y, sd.y), 4)
	t.out <- t.test(x, y)
	print(t.out)
	p <- round(t.out$p.value, 4)
	boxplot(x, y, names=c("Group_X", "Group_Y"), ylim=c(0,12))
	legend("topright", lty=0, legend=paste0("P-value=", p), cex=0.8)
	print(paste0("P-value of t-test: ", p))
}

## example usage (not run)

#par(mfrow=c(2,2)) # to display 4 plots 
#sim.data(6,1,6,1) # both groups sampled from the same underlying distribution
#sim.data(6,1,8,1) # large difference in means
#sim.data(6,2,6.5,2) # small difference in means and high variability
#sim.data(6,0.4, 6.5,0.4) # small difference in means and low variability 
