I've got 7 years of temperature data split into 4 seasonal variables (Spring, Summer, Autumn, Winter) each of which look like this (Spring example)
Day Month Year maxtp Season.Year Season
1 3 2008 13.6 2008 SP
2 3 2008 11.3 2008 SP
3 3 2008 5.4 2008 SP
I want to create a multiple new temperature series based on these observed data, one at a time in the following way (using a similar approach to this): Block sampling according to index in panel data
Using this code
newseries1 <- sample(Spring, size=91, replace = T, prob = NULL)
But this replicated the series 91 times, and isn't what I want.
I want to select an entire Spring block from any random season.year (2008-2014), then select a summer block from any year EXCEPT the year that was chosen previously, so any year other than 2008. The resampled year is then replaced so it can be resampled again the next time, just not consecutively.
I want to take a season.year from the spring variable, follow it with a different season.year for the summer variable, then another for autumn, and another for winter, and keep doing this until the resampled is the same length as the observed (7 years in this case).
So in summary I want to:
- Select a 'block' respecting the annual sequence (Spring from a random season.year) and begin a new series with it, then replace it so it can be sampled again.
- Follow Spring with summer from a non-consecutive year, and replace it.
- Keep going until the resampled series is the same length as the observed
- Repeat this process until there are 100 resampled series