Let's look at how it tsworks with different frequencies using documentation ( ?ts)
Let's say this is your data
dat <- data.frame(myts = sample(10, 24, replace = T),
Date = seq(as.Date("2008-10-11"), as.Date("2008-10-11") + 23, by = 1))
print(ts(dat$myts, frequency = 7, start = c(1950, 3)), calendar = T)
print(ts(dat$myts, frequency = 12, start = c(1950, 3)), calendar = T)
print(ts(dat$myts, frequency = 4, start = c(1950, 3)), calendar = T)
print(ts(dat$myts, frequency = 7), calendar = T)
3
1- ts 12 4 , 7 .
2- start - , , ( ).
3- , ts , ( , (1,1) )
, , ( , 52 ) (: 1 = , 2 = ..) start (. ?strftime)
startW <- as.numeric(strftime(head(dat$Date, 1), format = "%W"))
startD <- as.numeric(strftime(head(dat$Date, 1) + 1, format =" %w"))
print(ts(dat$myts, frequency = 7, start = c(startW, startD)), calendar = T)
, ( 2008-10-11) 39- 2008 .