Learn R Programming

humanize (version 0.2.0)

natural_time: Convert times to natural values relative to now.

Description

Given a datetime or a number of seconds, return a natural representation of that resolution that makes sense. Ago/From now determined by positive or negative values.

Usage

natural_time(value, use_months = TRUE)

Arguments

value

a datetime or a number of seconds

use_months

Boolean whether we should (imprecisely) use months as a unit

Examples

Run this code
# NOT RUN {
natural_time(Sys.time()-1)
natural_time(Sys.time()-100)
# }

Run the code above in your browser using DataLab