De: jim holtman
CC: "r-help@r-project.org"
Enviado: Martes 14 de febrero de 2012 20:56
Asunto: Re: [R] Creating categories from a date-time object
Will this do it for you:
> tmp <- seq(as.POSIXct('2011-08-01 13:00
Will this do it for you:
> tmp <- seq(as.POSIXct('2011-08-01 13:00'), as.POSIXct('2011-09-02 03:00'),
> by='45 min')
> # get just the hours
> hours <- format(tmp, "%H")
> weekdays <- format(tmp, "%w") %in% c('1', '2', '3', '4','5')
> office <- (hours >= '08') & (hours < '18') & weekdays
> result
2 matches
Mail list logo