[R] Combinations

Jonathan Christensen dzhonatan at gmail.com
Tue Oct 5 21:50:41 CEST 2010


Hi,

On Tue, Oct 5, 2010 at 3:52 AM, Trying To learn again
<tryingtolearnagain at gmail.com> wrote:
>
> Hi all,
>
> Reading more I have find a partial solution on a part of the proble in some
> part of the code it should appea something like:
>
> # NC: All the potential combinations 3^15
>
> if
>
> NC[price(i,j)=="1" & price(i,j)=="2"]----> extract this column
> then save all the columns that contain this pre-requisite.

That's an empty set, so it's really easy to extract.

Try something like

NC[,(NC[3,]=="1")]

Note the commas, which control whether you are selecting rows or
columns. I recommend reading "An Introduction to R":

http://cran.r-project.org/doc/manuals/R-intro.pdf

Jonathan


>
> 2010/10/4 Trying To learn again <tryingtolearnagain at gmail.com>
>
> > Hi all,
> >
> > I´ve been ill and I have lost a lot of time without seen the pc.
> >
> > I want you to help if you can if you want.
> >
> > Only I need an initial guide. I´ve been out a lot of time and I need a
> > hope. Is only for "joby" purposes.
> >
> > The problem:
> >
> > I want to simulate each of the posible combination in a play. Imagine they
> > play to games (football games) and you can choose "1", "X", "2" you must
> > choose this 15 times.
> >
> > So finally you will get a colum 15x1 si you have (3^15) posible colums.
> >
> > I want to extract all the columns were in the row 3 you can find an "2". Or
> > in the row 3 appears a "1" and row 3 "x".
> >
> > And extract them and save in a txt document.
> >
> > Sorry I know that I only ask but actually I feel very fool.
> >
> > If you give an initial guide will be sufficient.
> >
> > Many thanks for all in advace.
> >
> >
>
>        [[alternative HTML version deleted]]
>
>
> ______________________________________________
> 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.
>



More information about the R-help mailing list