EVOLUTION-MANAGER
Edit File: pretty.Date.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Pretty Breakpoints for Date-Time Classes</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for pretty.Date {grDevices}"><tr><td>pretty.Date {grDevices}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Pretty Breakpoints for Date-Time Classes</h2> <h3>Description</h3> <p>Compute a sequence of about <code>n+1</code> equally spaced ‘nice’ values which cover the range of the values in <code>x</code>, possibly of length one, when <code>min.n = 0</code> and there is only one unique <code>x</code>. </p> <h3>Usage</h3> <pre> ## S3 method for class 'Date' pretty(x, n = 5, min.n = n %/% 2, sep = " ", ...) ## S3 method for class 'POSIXt' pretty(x, n = 5, min.n = n %/% 2, sep = " ", ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>an object of class <code>"Date"</code> or <code>"POSIXt"</code> (i.e., <code>"POSIXct"</code> or <code>"POSIXlt"</code>). </p> </td></tr> <tr valign="top"><td><code>n</code></td> <td> <p>integer giving the <em>desired</em> number of intervals.</p> </td></tr> <tr valign="top"><td><code>min.n</code></td> <td> <p>nonnegative integer giving the <em>minimal</em> number of intervals.</p> </td></tr> <tr valign="top"><td><code>sep</code></td> <td> <p>character string, serving as a separator for certain formats (e.g., between month and year). </p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>further arguments for compatibility with the generic, ignored.</p> </td></tr> </table> <h3>Value</h3> <p>A vector (of the suitable class) of locations, with attribute <code>"labels"</code> giving corresponding formatted character labels. </p> <h3>See Also</h3> <p><code><a href="../../base/html/pretty.html">pretty</a></code> for the default method. </p> <h3>Examples</h3> <pre> pretty(Sys.Date()) pretty(Sys.time(), n = 10) pretty(as.Date("2000-03-01")) # R 1.0.0 came in a leap year ## time ranges in diverse scales:% also in ../../../../tests/reg-tests-1c.R require(stats) steps <- setNames(, c("10 secs", "1 min", "5 mins", "30 mins", "6 hours", "12 hours", "1 DSTday", "2 weeks", "1 month", "6 months", "1 year", "10 years", "50 years", "1000 years")) x <- as.POSIXct("2002-02-02 02:02") lapply(steps, function(s) { at <- pretty(seq(x, by = s, length = 2), n = 5) attr(at, "labels") }) </pre> <hr /><div style="text-align: center;">[Package <em>grDevices</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>