Re: [R] How to convert a single column into many rows

From: Kenn Konstabel <lebatsnok_at_gmail.com>
Date: Wed, 23 Mar 2011 11:25:27 +0000

On Wed, Mar 23, 2011 at 11:13 AM, Zablone Owiti <zowiti_at_ncst.go.ke> wrote:
> Dear users,
>
> I wish to convert a column of data  containing  pentad (5day mean data)
> from 1962 - 2000 into rows with each row having 73 values (ie. 73 pentads
> per year).
>
>
>
>  1962  pent1  pent2  ............pent73
>
> .
> .
> .
> .
>
> 2000 pent1 pent2 ..............pent73
>
>
> What commands should I use to achieve this?
>
> Thanks
>

my.pentads<-paste(rep(1962:2000, each=73), 1:73) # generate sample data  matrix(my.pentads, ncol=73, byrow=TRUE)

>
>
> ----------------------------
>
>  ZABLONE OWITI
>
>  GRADUATE STUDENT
>
> College of Atmospheric Science
>
> Nanjing University of Information, Science and Technology
>
> Add: 219 Ning Liu Rd, Nanjing, Jiangsu, 21004, P.R. China
>
>  Tel: +86-25-58731402
>
> Fax: +86-25-58731456
> Mob. 15077895632
> Website:  www.nuist.edu.cn
>
> ====================================================
>
> DO NOT PRINT THIS E-MAIL UNLESS NECESSARY. THE ENVIRONMENT CONCERNS US
> ALL.
>
> ______________________________________________
> 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.
>



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 Wed 23 Mar 2011 - 11:28:53 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 Wed 23 Mar 2011 - 13:00:24 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