R-helpers
 
I have been learning a little bit of R. I am simulating and i want to draw a 
normal curve for all my variables so that i will see the overlaps and reduce 
them, after that i want to draw a gragh of all the values that are in the data 
frame to see if it follows a normal distribution also. Lastly i will try to 
sample from this data. Please help and make suggestions.
 
My codes
#code for dataframe
Hypermarket <- matrix(rnorm(100, mean=50000, sd=5000))
Supermarket <- matrix(rnorm(400, mean=34000, sd=3000))
Minimarket  <- matrix(rnorm(1000, mean=10000,sd=2000))
Cornershop  <- matrix(rnorm(1500, mean=2500, sd=500))
Spazashop   <- matrix(rnorm(2000, mean=1000, sd=250))
dat=data.frame(type=c(rep("Hypermarket",100), rep("Supermarket",400),
rep("Minimarket",1000),rep("Cornershop",1500), rep("Spazashop",2000)),
value=c(Hypermarket, Supermarket, Minimarket, Cornershop,Spazashop))
dat
#code for histogram of Hypermarket(Please suggest something simple )
hist(Hypermarket, breaks=seq(30000, 65000, 1000), freq=F)
x<- seq(30000, 65000, 500)
lines(x, dnorm(x, 50000, 5000))




 
        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to