Thanoon,

My reply to your previous post should be more than enough for you to
accomplish your goal.  Please look over that script again:

ords <- seq(4)
p <- 10
N <- 1000
percent_change <- 0.9

R <- as.data.frame(replicate(p, sample(ords, N, replace = T)))

or alternatively as Mr. Barradas suggests with rbinom(), I leave options
for you to figure out.  Look at the help page, feel free to experiment with
different numbers and look at the output.  It is important you learn how to
explore new functions you are unfamiliar with.
R <- as.data.frame(replicate(p, rbinom(n=#, size=#, p=#)))

These lists are meant to help people with their code but not do the work
for them.  Given your prior questions to me as well I strongly suggest you
explore some R tutorials.  There are dozens online that should help you
with the basics and understand the above code more clearly.  Also,
regarding your prior question about tetratorich correlations.  You got an
error previously because it is not a standard correlation within the corr()
function.  You can get further information about a function by checking the
help pages ?corr.  You will need to try and find a package that provides a
function to do so or write the function yourself.  This may sound daunting
but if you take some time to learn how to write functions and the method
for the tetratorich correlation isn't that complex you should not have too
much of a problem.

Summing up:
1. Find some R tutorials to get the basics down
2. Try to understand the above code for your problem
3. Find a suitable R package for your specific correlation needs
4. or Learn to write functions and find the means to calculate the
tetratorich correlation.


Regards,
Charles Determan


On Wed, Apr 9, 2014 at 8:28 PM, thanoon younis
<thanoon.younis80@gmail.com>wrote:

> hi
>
> i want to simulate multivariate dichotomous data matrix with categories
> (0,1) and n=1000 and p=10.
>
> thanks alot in advance
>
>         [[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.
>



-- 
Charles Determan
Integrated Biosciences PhD Candidate
University of Minnesota

	[[alternative HTML version deleted]]


