[R] dates by week multiple years

Marlin Keith Cox m@r||nkcox @end|ng |rom gm@||@com
Wed Feb 6 06:52:04 CET 2019


Hello all, I did not attach data as this is probably simple answer that I
cannot find.

I am collecting daily data and would like to plot the data by week but now
that we are into the new year, my plots started over with 01 after the last
week of the year.  How can I continuously keep adding weeks such as 53, 54,
55, 56, etc. instead of starting over?

Below has worked for me until we moved into 2019.

data$Date    <- as.Date(data$TIMESTAMP,format="%m/%d/%y  %H:%M")
data$Week1    <- strftime(data$Date,format = "%V")
data$Week<-as.factor(data$Week1)

Keith

M. Keith Cox, Ph.D.
Principal
MKConsulting
17415 Christine Ave.
Juneau, AK 99801
U.S. 907.957.4606

	[[alternative HTML version deleted]]



More information about the R-help mailing list