I have the following data frame:
head(DWPhyto)
# A tibble: 6 x 2
date data
<date> <int>
1 2008-10-13 200
2 2009-03-25 200
3 2009-05-03 200
4 2009-05-13 200
5 2009-07-20 200
6 2009-12-22 200
str(DWPhyto)
Classes ‘tbl_df’, ‘tbl’ and 'data.frame': 1364 obs. of 2 variables:
$ date: Date, format: "2008-10-13" "2009-03-25" ...
$ data: int 200 200 200 200 200 200 200 200 200 200 ...
When I plot it in ggplot I get a time series of data by time across years 2008-2017 with the following code:
ggplot(DWPhyto, aes(date, data)) +
geom_line()
However, I want to split it up into singular years at a time, but when I do by setting xlim() it doesnt change the time series, but it removes the values on the x axis, how do you split it by year? Also once I split it into one year time frames, I want to add labels for each month of the year, but my dataset doesnt have regular sampling dates or sampling frequencies within each month period.
Is this possible?