Description Usage Arguments Value Examples
This function will combine the numeric or factor column of year and quarter into the form of "2021-Q1" whcih reffers to the year 2021 and the first quarter.
1 2 3 4 5 6 7 | combine_year_quarter(
data,
year_name = "year",
quarter_name = "quarter",
simple = TRUE,
quarter_trans = antgreens::quarter_readable
)
|
data |
a data frame. |
year_name |
character, default 'year'. It is the column name representing the year. |
quarter_name |
character, default 'quarter'. It is the column name representing the quarter. |
simple |
logical, default |
quarter_trans |
list containing 4 characters and the names of each element is 1, 2, 3, 4, which represents the four quarters. |
a data frame with column timeline
and without column year_name
and
quarter_name
.
1 2 | df <- data.frame(a = 2017:2021, b = c(1,2,2,4,3))
combine_year_quarter(df, year_name = 'a', quarter_name = 'b')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.