[R] why there is no quarters?

Dániel Kehl kehld at ktk.pte.hu
Mon Dec 16 13:35:43 CET 2013


Hi,

try

x <- seq(as.Date("2001/1/1"),as.Date("2010/1/1"),"3 months")

best,
daniel
________________________________________
Feladó: r-help-bounces at r-project.org [r-help-bounces at r-project.org] ; meghatalmazó: Pancho Mulongeni [p.mulongeni at namibia.pharmaccess.org]
Küldve: 2013. december 16. 13:05
To: 1248283536 at qq.com
Cc: r-help at r-project.org
Tárgy: Re: [R] why there is no quarters?

Hi,
I also would like to use quarters. I think a work around would be to just label each record in the dataframe by its quarter.
i.e. you add a factor called 'Quarter' with four levels (Q1 to Q4) for each row and you assign the level based on the month of the date.
You can easily do this with as.Date and as.character.

Pancho Mulongeni
Research Assistant
PharmAccess Foundation
1 Fouché Street
Windhoek West
Windhoek
Namibia

Tel:   +264 61 419 000
Fax:  +264 61 419 001/2
Mob: +264 81 4456 286

______________________________________________
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