Skip to content
Snippets Groups Projects
Commit ea1fc5f0 authored by Laura A DeCicco's avatar Laura A DeCicco
Browse files

Fixed leapyear bug.

parent 24ccc52b
No related branches found
No related tags found
No related merge requests found
...@@ -20,7 +20,7 @@ populateDateColumns <- function(rawData){ # rawData is a vector of dates ...@@ -20,7 +20,7 @@ populateDateColumns <- function(rawData){ # rawData is a vector of dates
leapOffset <- ifelse((year%%4 == 0) & ((year%%100 != 0) | (year%%400 == 0)), 0,1) leapOffset <- ifelse((year%%4 == 0) & ((year%%100 != 0) | (year%%400 == 0)), 0,1)
DateFrame$Day[DateFrame$Day > 59] <- DateFrame$Day[DateFrame$Day > 59] + leapOffset DateFrame$Day[DateFrame$Day > 59] <- DateFrame$Day[DateFrame$Day > 59] + leapOffset[DateFrame$Day > 59]
DateFrame$DecYear <- year + (DateFrame$Day -0.5)/366 DateFrame$DecYear <- year + (DateFrame$Day -0.5)/366
DateFrame$MonthSeq <- ((year-1850)*12)+DateFrame$Month DateFrame$MonthSeq <- ((year-1850)*12)+DateFrame$Month
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment