Skip to content
This repository was archived by the owner on Oct 13, 2022. It is now read-only.

Commit fedbf96

Browse files
authored
Merge pull request #62 from limnoliver/master
Update to RMevents_sample date handling
2 parents 033bd78 + 9244274 commit fedbf96

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

R/RMevents_sample.R

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,12 @@ RMevents_sample <- function(df,
112112
}
113113
tipsbystorm <- sub_tips
114114
} else {
115-
startRainDates <- as.POSIXct(c(startRainDates,BD), origin = "1970-01-01", tz = rain_timezone)
116-
endRainDates <- as.POSIXct(c(endRainDates,ED), origin = "1970-01-01", tz = rain_timezone)
115+
#startRainDates <- as.POSIXct(c(startRainDates,BD), origin = "1970-01-01", tz = rain_timezone)
116+
#endRainDates <- as.POSIXct(c(endRainDates,ED), origin = "1970-01-01", tz = rain_timezone)
117+
startRainDates <- c(startRainDates,BD)
118+
endRainDates <- c(endRainDates,ED)
119+
120+
117121
if (nrow(sub_tips) > 0) {
118122
event <- event + 1
119123
} else {
@@ -127,8 +131,8 @@ RMevents_sample <- function(df,
127131
}
128132
}
129133

130-
dfsamples$StartDate <- startRainDates
131-
dfsamples$EndDate <- endRainDates
134+
dfsamples$StartDate <- as.POSIXct(startRainDates, origin = '1970-01-01', tz = rain_timezone)
135+
dfsamples$EndDate <- as.POSIXct(endRainDates, origin = '1970-01-01', tz = rain_timezone)
132136
dfsamples$rain <- rainDepth
133137
dfsamples$stormnum <- 1:nrow(dfsamples)
134138

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# tests the function discharge_events
22

3-
# test discharge record that starts and ends in mid-storm
3+
# test discharge record that starts and ends in mid-storm
4+
5+
# test time zones

0 commit comments

Comments
 (0)