Skip to content

Commit

Permalink
Avoid R crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Schuemie authored and Schuemie committed Apr 20, 2021
1 parent d6e1bcd commit 1a8acc2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions extras/CodeToRerunCvs.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Delete NA critical values ------------------------------
cvFiles <- list.files(outputFolder, ".*_withCvs.csv")
for (cvFile in cvFiles) {
cvs <- readr::read_csv(file.path(outputFolder, cvFile), col_types = readr::cols())
cvs <- readr::read_csv(file.path(outputFolder, cvFile), col_types = readr::cols(), guess_max = 1e5)
idx <- is.na(cvs$criticalValue)
if (any(idx)) {
message(sprintf("Removing %d (%0.1f%%) NA values from %s", sum(idx), 100*mean(idx), cvFile))
Expand Down Expand Up @@ -75,9 +75,9 @@ sccsCvs <- Eumaeus:::loadEstimates(file.path(outputFolder, "sccsSummary_withCvs.
.data$criticalValue)

cvs <- bind_rows(historicComparatorCvs,
cohortMethodCvs,
caseControlCvs,
sccsCvs)
cohortMethodCvs,
caseControlCvs,
sccsCvs)
colnames(cvs) <- SqlRender::camelCaseToSnakeCase(colnames(cvs))

estimate <- readr::read_csv(file.path(outputFolder, "export", "estimate.csv"), col_types = readr::cols(), guess_max = 1e5)
Expand Down

0 comments on commit 1a8acc2

Please sign in to comment.