EVOLUTION-MANAGER
Edit File: guess_formats.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: Guess possible date-times formats from a character vector</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 guess_formats {lubridate}"><tr><td>guess_formats {lubridate}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Guess possible date-times formats from a character vector</h2> <h3>Description</h3> <p>Guess possible date-times formats from a character vector. </p> <h3>Usage</h3> <pre> guess_formats( x, orders, locale = Sys.getlocale("LC_TIME"), preproc_wday = TRUE, print_matches = FALSE ) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>input vector of date-times.</p> </td></tr> <tr valign="top"><td><code>orders</code></td> <td> <p>format orders to look for. See examples.</p> </td></tr> <tr valign="top"><td><code>locale</code></td> <td> <p>locale to use. Defaults to the current locale.</p> </td></tr> <tr valign="top"><td><code>preproc_wday</code></td> <td> <p>whether to preprocess weekday names. Internal optimization used by <code>ymd_hms()</code> family of functions. If <code>TRUE</code>, weekdays are substituted with %a or %A accordingly, so that there is no need to supply this format explicitly.</p> </td></tr> <tr valign="top"><td><code>print_matches</code></td> <td> <p>for development purposes mainly. If <code>TRUE</code>, prints a matrix of matched templates.</p> </td></tr> </table> <h3>Value</h3> <p>a vector of matched formats </p> <h3>Examples</h3> <pre> x <- c('February 20th 1973', "february 14, 2004", "Sunday, May 1, 2000", "Sunday, May 1, 2000", "february 14, 04", 'Feb 20th 73', "January 5 1999 at 7pm", "jan 3 2010", "Jan 1, 1999", "jan 3 10", "01 3 2010", "1 3 10", '1 13 89', "5/27/1979", "12/31/99", "DOB:12/11/00", "-----------", 'Thu, 1 July 2004 22:30:00', 'Thu, 1st of July 2004 at 22:30:00', 'Thu, 1July 2004 at 22:30:00', 'Thu, 1July2004 22:30:00', 'Thu, 1July04 22:30:00', "21 Aug 2011, 11:15:34 pm", "-----------", "1979-05-27 05:00:59", "1979-05-27", "-----------", "3 jan 2000", "17 april 85", "27/5/1979", '20 01 89', '00/13/10', "-------", "14 12 00", "03:23:22 pm") guess_formats(x, "BdY") guess_formats(x, "Bdy") ## m also matches b and B; y also matches Y guess_formats(x, "mdy", print_matches = TRUE) ## T also matches IMSp order guess_formats(x, "T", print_matches = TRUE) ## b and B are equivalent and match, both, abreviated and full names guess_formats(x, c("mdY", "BdY", "Bdy", "bdY", "bdy"), print_matches = TRUE) guess_formats(x, c("dmy", "dbY", "dBy", "dBY"), print_matches = TRUE) guess_formats(x, c("dBY HMS", "dbY HMS", "dmyHMS", "BdY H"), print_matches = TRUE) guess_formats(x, c("ymd HMS"), print_matches = TRUE) </pre> <hr /><div style="text-align: center;">[Package <em>lubridate</em> version 1.7.9 <a href="00Index.html">Index</a>]</div> </body></html>