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

Commit

Permalink
Merge pull request #62 from limnoliver/master
Browse files Browse the repository at this point in the history
Update to RMevents_sample date handling
  • Loading branch information
limnoliver committed Sep 20, 2018
2 parents 033bd78 + 9244274 commit fedbf96
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
12 changes: 8 additions & 4 deletions R/RMevents_sample.R
Expand Up @@ -112,8 +112,12 @@ RMevents_sample <- function(df,
}
tipsbystorm <- sub_tips
} else {
startRainDates <- as.POSIXct(c(startRainDates,BD), origin = "1970-01-01", tz = rain_timezone)
endRainDates <- as.POSIXct(c(endRainDates,ED), origin = "1970-01-01", tz = rain_timezone)
#startRainDates <- as.POSIXct(c(startRainDates,BD), origin = "1970-01-01", tz = rain_timezone)
#endRainDates <- as.POSIXct(c(endRainDates,ED), origin = "1970-01-01", tz = rain_timezone)
startRainDates <- c(startRainDates,BD)
endRainDates <- c(endRainDates,ED)


if (nrow(sub_tips) > 0) {
event <- event + 1
} else {
Expand All @@ -127,8 +131,8 @@ RMevents_sample <- function(df,
}
}

dfsamples$StartDate <- startRainDates
dfsamples$EndDate <- endRainDates
dfsamples$StartDate <- as.POSIXct(startRainDates, origin = '1970-01-01', tz = rain_timezone)
dfsamples$EndDate <- as.POSIXct(endRainDates, origin = '1970-01-01', tz = rain_timezone)
dfsamples$rain <- rainDepth
dfsamples$stormnum <- 1:nrow(dfsamples)

Expand Down
4 changes: 3 additions & 1 deletion tests/testthat/test_discharge_events.R
@@ -1,3 +1,5 @@
# tests the function discharge_events

# test discharge record that starts and ends in mid-storm
# test discharge record that starts and ends in mid-storm

# test time zones

0 comments on commit fedbf96

Please sign in to comment.