Skip to content

Commit

Permalink
take mean of log10 parking in 'uta_export' for #13
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed May 10, 2023
1 parent 14c6420 commit 0b63d89
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: utaengine
Title: Routing and aggregation engine for 'Urban Transport Analyst'
Version: 0.1.0.153
Version: 0.1.0.154
Authors@R:
person(given = "Mark",
family = "Padgham",
Expand Down
8 changes: 7 additions & 1 deletion R/uta-batch.R
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,13 @@ uta_export <- function (city, soc, results_path) {
for (i in unique (pt_index)) {
index <- which (pt_index == i)
for (v in c (vars, extra_vars)) {
soc [[v]] [i] <- mean (res [[v]] [index], na.rm = TRUE)
if (v == "parking") {
p <- res$parking [index]
p <- p [which (p > 0 & !is.nan (p))]
soc [[v]] [i] <- 10^mean (log10 (p), na.rm = TRUE)
} else {
soc [[v]] [i] <- mean (res [[v]] [index], na.rm = TRUE)
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"codeRepository": "https://github.com/UrbanAnalyst/uta-engine",
"issueTracker": "https://github.com/UrbanAnalyst/uta-engine/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.1.0.153",
"version": "0.1.0.154",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down

0 comments on commit 0b63d89

Please sign in to comment.