Learn R Programming

SeaVal (version 1.1.1)

MSD_to_YM: Converts time given as 'months since date' (MSD) into years and months (YM)

Description

Converts time given as 'months since date' (MSD) into years and months (YM)

Usage

MSD_to_YM(dt, timecol = "time", origin = "1981-01-01")

Value

data table with two new columns 'month' and 'year', the timecol is deleted.

Arguments

dt

a data table.

timecol

name of the column containing the time.

origin

The time column contains time in the format month since which date?

Examples

Run this code
dt = MSD_to_YM(data.table(time = 0:12))

Run the code above in your browser using DataLab