On Nov 15, 2009, at 4:11 PM, martin08 wrote:
>
> Hi all,
>
> I am new to R. Can someone please give me some hints in how to do the
> following things:
>
> 1- Get ONE permutation of a set. I have looked at the gregmisc
> package's
> permutations() method, but I just want to get one permutation at a
> time.
Assuming that set1 is your set object and x is <= number of
permutations of z things from set1, then
permutations(set1, z)[x] will give your the x-th permutation.
the "[" operator/function can often be appended to the end of a
function to extract the desired subset.
>
> 2- Simulate a Markov chain in R. For instance, I want to simulate
> the simple
> random walk problem, in which a person can walk randomly around 4
> places. I
> know how to set up the transition matrix in R. I'm stuck at what to
> do next.
Learn to search for yourself:
http://search.r-project.org/cgi-bin/namazu.cgi?query=%22transition+matrix%22+markov&max=100&result=normal&sort=score&idxname=Rhelp08&idxname=Rhelp02
>
> I'm grateful if someone can give me hint or a pointer.
>
> Thanks.
>
> Martin
> --
> View this message in context:
http://old.nabble.com/how-to-permute%2C-simulate-Markov-chain-tp26363411p26363411.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at 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.
David Winsemius, MD
Heritage Laboratories
West Hartford, CT