How to get quarters in R?
If you want to get a quarter in a character format, then you can use R base function quarters. If you want to get a quarter from date in R as a number, you can use the quarter function from the lubridate package. The function will extract only a quarter number, and you can use that as it is.
What is SQL quarter?
The QUARTER() function returns the quarter of the year for a given date value (a number from 1 to 4).