Re: [R] how to select out some columns using cbind()

From: ss <affysnp_at_gmail.com>
Date: Sat, 14 Jun 2008 19:40:38 -0400

Thank you very much, Jim! Have a good evening!

Allen

On Sat, Jun 14, 2008 at 7:35 PM, jim holtman <jholtman_at_gmail.com> wrote:

> newdata1 <- data1[, seq(from=2, to=ncol(data1), by=7)]
>
> On Sat, Jun 14, 2008 at 7:27 PM, ss <affysnp_at_gmail.com> wrote:
> > Hello! I have a matrix:
> >
> >> dim(data1)
> > [1] 34176 581
> >
> > of 34176 rows and 581 columns,
> >
> > I want to make a new matrix data2 by taking the 2nd column, 9th column,
> 16th
> > column....
> >
> > the column number is in the order of:
> >
> > 2
> > 9 (2+7)
> > 16 (9+7)
> > 23 (16+7)
> > ...
> >
> > the new matrix data2 should include 83 columns, is there an easy way to
> > do that using cbind() function?
> >
> > Thanks a lot!
> >
> > Allen
> >
> > [[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.
> >
>
>
>
> --
> Jim Holtman
> Cincinnati, OH
> +1 513 646 9390
>
> What is the problem you are trying to solve?
>

        [[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. Received on Sat 14 Jun 2008 - 23:46:48 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 15 Jun 2008 - 00:30:52 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive