Learn R Programming

tabplot (version 0.11-2)

datetime2fac: Create a factor vector out of a date-time vector

Description

Create a factor vector out of a date-time vector from class "POSIXt" or "Date".

Usage

datetime2fac(p, rng = range(p, na.rm = TRUE))

Arguments

p
date-time vector
rng
range of the factor.

Value

  • A factor vector.

Details

The range rng is cut according to different pretty rounded time periods. The cut with the number of levels that is closest to 6 is chosen. Vector p is cut accordingly. Values of p outside rng are translated to NA.