View source: R/previous_quarter.R
previous_quarter | R Documentation |
Given the latest quarter as a string in the format "2020 Q4", returns a string in the same format representing the previous quarter, or previous quarters going further back if desired.
previous_quarter(quarter, quarters_ago = 1)
quarter |
The latest quarter as a string, starting with the year, a 'q' or 'Q', then the quarter number (1,2,3 or 4), e.g. "2020 Q2". |
quarters_ago |
Number of quarters to go back. Default is 1. If negative, the number of quarters to go forward. |
A character object.
previous_quarter("2020 Q1") # returns "2019 Q4"
previous_quarter("2020 Q1", 3) # returns "2019 Q2"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.