Convert YYYY-MM-DD to YYYY-YY Qx in R
问题 I'm trying to plot data by quarter then display in ggplot. Dates in dataset are of the format YYYY-MM-DD, and I want the ggplot x-axis to display the financial year like YYYY-YY Qx. The financial year starts July 1. Data is in long format. This is where I've got to: Data set named: TOX TREE_ID PM_Date variable value 1: 2013000584 2013-04-02 elm 0 2: 2013000498 2013-06-11 elm 1 3: 2013000123 2013-09-03 maple 0 4: 2013000642 2014-02-15 maple 0 5: 2013000778 2016-07-08 maple 1 PM_Dateq <- as