[R] 2 questions : format and hh:mm

Jacques VESLOT jacques.veslot at cirad.fr
Thu Jul 29 12:02:50 CEST 2004


in order to generate your series, maybe :
> format(seq(ISOdate(2003,1,1, 0, 0, 0, tz=""), by="min",
length=1440),format="%H:%M")

jacques
-----Message d'origine-----
De : r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch]De la part de Bruno Cutayar
Envoyé : jeudi 29 juillet 2004 13:43
À : r-help at stat.math.ethz.ch
Objet : [R] 2 questions : format and hh:mm




Dear R-users,
i have two questions :

1- first of all, i wish to know the way to obtain a serie with a format
like "00" : ( "01","02","03","04"....) or like postal code
("01100","02222").
for instance, i do :
 > format(strptime(as.character(c(1:4)),"%H"),"%H")
but it sounds complicate and not really efficient....!

 2- i search to generate a serie of hours and minutes on 24h :
"00:00" , "00:01", "00:02", "00:03", ...,...,  "23:59"
for instance, i do :
 > x <- format( strptime (as.character(rep(0:23,each=60)),"%H"),"%H")
 > y <- format( strptime (as.character(rep(0:59,24)),"%M"),"%M")
 > paste (x,y,sep=":")
it works but is it an another way to obtain this ?

thanks
Bruno





Si vous n'etes pas destinataires de ce message, merci d'avertir l'expediteur
de l'erreur de distribution et de le detruire immediatement.
Ce message contient des informations confidentielles ou appartenant a La
Francaise des Jeux. Il est etabli a l'intention exclusive de ses
destinataires. Toute divulgation, utilisation, diffusion ou reproduction
(totale ou partielle) de ce message ou des informations qu'il contient, doit
etre prealablement autorisee.
Tout message electronique est susceptible d'alteration et son integrite ne
peut etre assuree. La Francaise des Jeux decline toute responsabilite au
titre de ce message s'il a ete modifie ou falsifie.

If you are not the intended recipient of this e-mail, please notify the
sender of the wrong delivery and delete it immediately from your system.
This e-mail contains confidential information or information belonging to La
Francaise des Jeux and is intended solely for the addressees. The
unauthorised disclosure, use, dissemination or copying (either whole or
partial) of this e-mail, or any information it contains, is prohibited.
E-mails are susceptible to alteration and their integrity cannot be
guaranteed. La Francaise des Jeux shall not be liable for this e-mail if
modified or falsified.

______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

-----------------------------------------------------
CIRAD 3P Reunion - MailScanner - NO VIRUS found
-----------------------------------------------------


-----------------------------------------------------
CIRAD 3P Reunion - MailScanner - NO VIRUS found




More information about the R-help mailing list