dateConv: Convert dates from numbers to Date

View source: R/dateConv.R

dateConvR Documentation

Convert dates from numbers to Date

Description

Since data imported from Excel or simply manipulated within R often changes date and time data to numeric, dateConv converts dates from decimal numbers to Date.

Usage

dateConv(x, dataSource = "Excel")

Arguments

x

A numeric string

dataSource

Either "Excel" (default), "Unix" or "R" depending on where the data are coming from. Excel data have an origin of Dec. 30, 1899 whereas Unix and R data have an origin of Jan. 1, 1970.

Value

Returns a date object

Examples

dateConv(43252)
# "2018-06-01"

dateConv(18526, dataSource = "R")
# "2020-09-21"


shirewoman2/LaurasHelpers documentation built on Oct. 22, 2023, 2:07 p.m.