EVOLUTION-MANAGER
Edit File: make_difftime.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: Create a difftime object.</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 make_difftime {lubridate}"><tr><td>make_difftime {lubridate}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Create a difftime object.</h2> <h3>Description</h3> <p><code>make_difftime()</code> creates a difftime object with the specified number of units. Entries for different units are cumulative. difftime displays durations in various units, but these units are estimates given for convenience. The underlying object is always recorded as a fixed number of seconds. </p> <h3>Usage</h3> <pre> make_difftime(num = NULL, units = "auto", ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>num</code></td> <td> <p>Optional number of seconds</p> </td></tr> <tr valign="top"><td><code>units</code></td> <td> <p>a character vector that lists the type of units to use for the display of the return value (see examples). If <code>units</code> is "auto" (the default) the display units are computed automatically. This might create undesirable effects when converting <code>difftime</code> objects to numeric values in data processing.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>a list of time units to be included in the difftime and their amounts. Seconds, minutes, hours, days, and weeks are supported. Normally only one of <code>num</code> or <code>...</code> are present. If both are present, the <code>difftime</code> objects are concatenated.</p> </td></tr> </table> <h3>Details</h3> <p>Conceptually, difftime objects are a type of duration. They measure the exact passage of time but do not always align with measurements made in larger units of time such as hours, months and years. This is because the length of larger time units can be affected by conventions such as leap years and Daylight Savings Time. <span class="pkg">lubridate</span> provides a second class for measuring durations, the Duration class. </p> <h3>Value</h3> <p>a difftime object </p> <h3>See Also</h3> <p><code><a href="duration.html">duration()</a></code>, <code><a href="as.duration.html">as.duration()</a></code> </p> <h3>Examples</h3> <pre> make_difftime(1) make_difftime(60) make_difftime(3600) make_difftime(3600, units = "minute") # Time difference of 60 mins make_difftime(second = 90) # Time difference of 1.5 mins make_difftime(minute = 1.5) # Time difference of 1.5 mins make_difftime(second = 3, minute = 1.5, hour = 2, day = 6, week = 1) # Time difference of 13.08441 days make_difftime(hour = 1, minute = -60) # Time difference of 0 secs make_difftime(day = -1) # Time difference of -1 days make_difftime(120, day = -1, units = "minute") # Time differences in mins </pre> <hr /><div style="text-align: center;">[Package <em>lubridate</em> version 1.7.9 <a href="00Index.html">Index</a>]</div> </body></html>