[R] sorting by date
stephen sefick
ssefick at gmail.com
Tue Aug 3 04:18:37 CEST 2010
sort_df in package reshape?
On Mon, Aug 2, 2010 at 9:07 PM, Leigh E. Lommen
<leigh.lommen at courtesycorporation.com> wrote:
> a <- c( 20071031,20071130, 20071231)
> sort(a)
>
> Or if you want convert to date:
> sort(strptime(a, '%Y%m%d'))
>
> Okay, but what if you have information in the other columns?
>
>
>
> For example:
>
>
>
> 20071031 information info
>
> 20071130 information info
>
> 20071231 information info
>
> Etc.
>
>
>
> Thanks.
>
> Leigh
>
>
>
> ________________________________
>
> From: Henrique Dallazuanna [mailto:wwwhsd at gmail.com]
> Sent: Monday, August 02, 2010 8:12 PM
> To: Leigh E. Lommen
> Cc: r-help at r-project.org
> Subject: Re: [R] sorting by date
>
>
>
> a <- c( 20071031,20071130, 20071231)
> sort(a)
>
> Or if you want convert to date:
> sort(strptime(a, '%Y%m%d'))
>
> On Mon, Aug 2, 2010 at 9:03 PM, Leigh E. Lommen <leigh.lommen at courtesycorporation.com> wrote:
>
> I am unsure how to sort a column by date if it is currently in the form:
>
> YYYYMMDD
>
>
>
> For example the months:
>
> 20071031
>
> 20071130
>
> 20071231
>
> Etc.
>
>
>
> Regards,
>
> Leigh
>
>
> [[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.
>
>
>
>
> --
> Henrique Dallazuanna
> Curitiba-Paraná-Brasil
> 25° 25' 40" S 49° 16' 22" O
>
>
> [[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.
>
>
--
Stephen Sefick
____________________________________
| Auburn University |
| Department of Biological Sciences |
| 331 Funchess Hall |
| Auburn, Alabama |
| 36849 |
|___________________________________|
| sas0025 at auburn.edu |
| http://www.auburn.edu/~sas0025 |
|___________________________________|
Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods. We are mammals, and have not exhausted the
annoying little problems of being mammals.
-K. Mullis
More information about the R-help
mailing list