dm_date: Change System Date to Google Sheets date.

Description Usage Arguments Value Examples

Description

dm_date converts the output from R's Sys.date() to the format currently used in our Daily Mini Google Spreadsheet. This spreadsheet format uses an abbreviated day of the week, an abbreviated month, and the numeric day of the month.

Usage

1
dm_date(date = Sys.Date(), shift = 0)

Arguments

date

an optional parameter to specify the date in a YYY-MM-DD format. Default is Sys.Date().

shift

An integer to define the number of days by which the data entry date should be shifted. Default is 0. The day after today (tomorrow) is +1, yesterday is -1, etc.

Value

The function returns a character string of the re-formatted date. For example, the Sys.Date() output on April 2, 2017 is "2017-04-02", and the newly returned character string would be "Sun, Apr 02".

Examples

1
2
3
dm_date()    # today
dm_date(shift = 1)   # tomorrow
dm_date(shift = -7)  # one week ago

bochocki/slackrsheets documentation built on May 8, 2019, 9:46 a.m.