How do you find the standard deviation of a dataset over a certain period?
I think you can only do that if your dataset contains a column encoding the date (see Dates and related info) that you can filter by.
See below a simulated dataset of such type.
df &lt;- data.frame(&quot;x&quot; = rnorm(4000, mean = 0, sd = 1+(1:4000)/1000), &quot;d&quot; = seq.Date(from = as.Date(&quot;2010-01-01&quot;), by = &quot;day&quot;, length.out = 4000))

Then it should be pretty standard:
# sd of x over the whole dataset
sd(df$x)
#[1] 3.121845

# define a logical vector identifying the dates of interest
interval &lt;- (df$d &gt;= as.Date("2010-11-17")) &amp; (df$d &lt;= as.Date(&quot;2020-11-16&quot;))

# calculate the sd over the dates of interest only
sd(df[interval,]$x)
#[1] 3.227157

# display it as a plot
plot(x ~ d, df, col = ifelse(interval,2,1))

Only, make sure you check what your date format is, as that might depend on your system. Like:
Sys.Date()
[1] &quot;2021-03-21&quot;

This shows that my system expresses the date as &quot;year-month-day&quot;. That's the format I used for the filtering in as.Date conversions.
[Note: there might be clever ways to use other formats].