There must be a very easy way to do this but I don’t know what it is…
As the title says, I would like to know how I can plot every second timestep of a time series in R? For example, I have half hourly data but I only want to plot the data on the hour e.g. I have
10:00 0
10:30 1
11:00 2
11:30 3
12:00 4
I just want to plot
10:00 0
11:00 2
12:00 4
Slightly less verbose and not quite as clear as Ben’s solution but you can use vector recycling and indexing using a boolean to achieve this (as long as you’re just interested in every other observation).