Thanks. That worked.
On Mon, Mar 23, 2009 at 2:17 PM, Phil Spector
<spector@stat.berkeley.edu>wrote:
> Suppose your matrix is called "x". Then
>
> x[,seq(1,ncol(x),n)]
>
> will give you what you want.
>
> - Phil Spector
> Statistical Computing Facility
> Department of Statistics
> UC Berkeley
> spector@stat.berkeley.edu
>
>
>
> On Mon, 23 Mar 2009, akintayo holder wrote:
>
> Hi,
>> I have a matrix and I want to create a matrix that includes every nth
>> column
>> of the original matrix. Does anyone know how I can go about doing that
?
>> Or
>> if you have an idea how I can do the same thing with a data frame ? If
you
>> can just point me towards the appropriate function I would appreciate
it.
>> Thanks
>>
>> [[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]]