<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello,
<div>I need to create a sequence of dates separated by one hour.</div><div>I found in the examples of axis.POSIXct() that it is possible to create it:</div><div><br></div><div><p style="margin: 0.0px 0.0px 16.0px 0.0px"><font face="Courier" size="5" color="#666666" style="font: 16.0px Courier; color: #666666"><b>Examples</b></font></p></div><div><div>with(beaver1, {</div> <div>time <- strptime(paste(1990, day, time %/% 100, time %% 100),</div> <div> "%Y %j %H %M")</div> <div>plot(time, temp, type="l") # axis at 4-hour intervals.</div> <div># now label every hour on the time axis</div> <div>plot(time, temp, type="l", xaxt="n")</div> <div>r <- as.POSIXct(round(range(time), "hours"))</div> <div>axis.POSIXct(1, at=seq(r[1], r[2], by="hour"), format="%H")</div> <div>})</div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div>I tried, but I received the error:</div><div><br class="webkit-block-placeholder"></div><div><div>date_graph_in<-chron("1/11/1907","00:39:00",format = c(dates = "d/m/y", times = "h:m:s"));</div><div>date_graph_fin<-chron("1/11/1998","00:39:00",format = c(dates = "d/m/y", times = "h:m:s"));</div><div>data_seq<-seq(date_graph_in,date_graph_fin,by="hour")</div><div><br class="webkit-block-placeholder"></div><div>Error in seq.dates(date_graph_in, date_graph_fin, by = "hour") : </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>"by" must be one of days, weeks, months, or years</div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div>It seems it is possible to create date sequences separated of days, weeks, months or years but not for hours.</div><div><br class="webkit-block-placeholder"></div><div>Does someone know how to do it?</div><div>Thanks in advance,</div><div><br class="webkit-block-placeholder"></div><div>Matteo</div><div><br></div></div></div><div> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div>---------------------------------</div><div>Matteo Dall'Amico</div><div>PhD candidate</div><div>CUDAM and department of Civil and Environmental Engineering</div><div>Universita' degli Studi di Trento</div><div>Via Mesiano 77 - 38050 Trento - Italy</div><div>email: <a href="mailto:matteo.dallamico@ing.unitn.it">matteo.dallamico@ing.unitn.it</a></div><div>Tel. +39 0461 882610</div><div>Fax +39 0461 882672</div><div><a href="http://www.dottorato.it/trento/">http://www.dottorato.it/trento/</a></div><div>---------------------------------</div><br class="Apple-interchange-newline"></span></span></span></span></span></span></span> </div><br></body></html>