Thank you very much, now i can proceed to my next task. THANK YOU 
 

--- On Wed, 9/9/09, Schalk Heunis <schalk.heunis@enerweb.co.za> wrote:


From: Schalk Heunis <schalk.heunis@enerweb.co.za>
Subject: Re: [R] Combining simulated data
To: "KABELI MEFANE" <kabelimefane@yahoo.co.uk>
Cc: R-help@r-project.org
Date: Wednesday, 9 September, 2009, 8:45 PM


Kabeli

I think this is what you want:

Hypermarket <- matrix(rnorm(10, mean=20000, sd=7000))
Supermarket <- matrix(rnorm(15, mean=12000, sd=4000))
Minimarket   <- matrix(rnorm(20, mean=10000, sd=4000))
Cornershop  <- matrix(rnorm(20, mean= 8000, sd=3000))
Spazashop   <- matrix(rnorm(35, mean= 7000, sd=3000))
rbind(Hypermarket,Supermarket,Minimarket,Cornershop,Spazashop)

This creates a matrix with one column and 100 rows.  You can add names
also by doing something like this for e.g. Spazashop
Spazashop   <- matrix(rnorm(35, mean= 7000, sd=3000), dimnames =
list(paste("Spazashop",1:35)))

Hope this helps.

Schalk Heunis



On Wed, Sep 9, 2009 at 2:26 AM, KABELI MEFANE<kabelimefane@yahoo.co.uk> wrote:
> R helpers
>
> Please help me combine the simulated data to a form of table where: Hypermarket have 10 rows, supermarket have 15 rows,......., spazashops with 35 rows.
>
> Hypermarket <- rnorm(10, mean=20000, sd=7000)
> Supermarket <- rnorm(15, mean=12000, sd=4000)
> Minimarket   <- rnorm(20, mean=10000, sd=4000)
> Cornershop  <- rnorm(20, mean= 8000, sd=3000)
> Spazashop   <- rnorm(35, mean= 7000, sd=3000)
>
> i am trying to write a code to simulate data such that i have 10% of hypermarkets, 15% of supermarkets,etc.
>
>
>
>
>        [[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.
>
>



      
	[[alternative HTML version deleted]]


