Commit 64080567 authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

fix: coerce single-column extraction of data.frame to vector to avoid bug using tibble data.frame

Refs #49
parent a8dd6c45
Pipeline #28217 passed with stage
in 1 minute and 31 seconds
...@@ -12,7 +12,7 @@ PrepGR <- function(ObsDF = NULL, DatesR = NULL, Precip = NULL, PotEvap = NULL, Q ...@@ -12,7 +12,7 @@ PrepGR <- function(ObsDF = NULL, DatesR = NULL, Precip = NULL, PotEvap = NULL, Q
if (!is.null(ObsDF)) { if (!is.null(ObsDF)) {
if (ncol(ObsDF) >= 5) { if (ncol(ObsDF) >= 5) {
TempMean <- ObsDF[, 5L] TempMean <- ObsDF[, 5L, drop = TRUE]
} }
} }
...@@ -37,10 +37,10 @@ PrepGR <- function(ObsDF = NULL, DatesR = NULL, Precip = NULL, PotEvap = NULL, Q ...@@ -37,10 +37,10 @@ PrepGR <- function(ObsDF = NULL, DatesR = NULL, Precip = NULL, PotEvap = NULL, Q
} }
if (!is.null(ObsDF)) { if (!is.null(ObsDF)) {
ObsDF <- data.frame(DatesR = ObsDF[, 1L], ObsDF <- data.frame(DatesR = ObsDF[, 1L, drop = TRUE],
Precip = ObsDF[, 2L], Precip = ObsDF[, 2L, drop = TRUE],
PotEvap = ObsDF[, 3L], PotEvap = ObsDF[, 3L, drop = TRUE],
Qobs = ObsDF[, 4L], Qobs = ObsDF[, 4L, drop = TRUE],
TempMean = TempMean) TempMean = TempMean)
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment