diff --git a/DESCRIPTION b/DESCRIPTION index 003c8b4..2c85084 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: superblock Type: Package Title: Analyses of potential superblock -Version: 0.1.0.108 +Version: 0.1.0.110 Authors@R: person(given = "Mark", family = "Padgham", diff --git a/R/parking-areas.R b/R/parking-areas.R index 09379b3..ef86e7b 100644 --- a/R/parking-areas.R +++ b/R/parking-areas.R @@ -97,7 +97,7 @@ parking_structure <- function (hws) { parking, function (p) { p2 <- p [, 2, drop = FALSE] - index <- which (p2 > 0 && p2 %% l == 0) + index <- which (p2 [, 1] > 0 & p2 [, 1] %% l == 0) index_ids <- match (rownames (p2) [index], hws$osm_id) n <- floor (hw_lens [index_ids] / l) cbind (n, rownames (p2) [index]) diff --git a/R/parking-times.R b/R/parking-times.R index e87e781..753d255 100644 --- a/R/parking-times.R +++ b/R/parking-times.R @@ -239,7 +239,7 @@ parking_as_dodgr_net <- function (osmdat) { num_parking_spaces <- edge_new <- .vx0_x <- .vx0_y <- .vx1_x <- .vx1_y <- NULL - requireNamespace ("fs") + requireNamespace ("fs", quietly = TRUE) net <- dodgr::weight_streetnet ( osmdat$dat_sc, diff --git a/README.Rmd b/README.Rmd index d38e8e3..6db0eef 100644 --- a/README.Rmd +++ b/README.Rmd @@ -50,3 +50,36 @@ the area is converted to a superblock: ```{r sb-summary} sb_summary (osmdat) ``` + + +--- + +### Analysis of parking times + +There is also a function to estimate how long it takes to find car park as a +function of the proportion of available car parking spaces. The results are +compared to equivalent times to drive to the nearest large parking facility +("garage" in the graph below), to park a car, and then walk back to the place +of residence. + +```{r parking-times, echo = FALSE, warn = FALSE} +times <- sb_parking_times (osmdat, ntrials = 10, n_props = 20, prop_min = 0.7) +plot (times) +``` + + +```{r parking-times-fakey, eval = FALSE} +times <- sb_parking_times (osmdat) +plot (times) +``` + +The results shows how long it takes to find a parking space for +an average attempt ("park(50%)"), for one out of every four +attempts ("park(75%)"), and for one out of every ten attempts +("park(90%)"). Above around 97-98% occupancy, which is the general state most +nights, an "average" attempt may still take under 5 minutes, yet one out of +four times will take 10 minutes or more, and one out of ten times it will take +more than half an hour. The horizontal lines shows the time it would take on +average for all residents of the area to drive directly to a nearby large +parking facility ("garage"), park, and walk back. Beyond around 95% occupancy, +it is always quicker to park in a garage and walk back. diff --git a/README.md b/README.md index 88d97f6..3fcb802 100644 --- a/README.md +++ b/README.md @@ -34,12 +34,41 @@ sb_summary (osmdat) #> • Proportion open space: 7.36% #> • Proportion roads: 15.7%, of which: #> • 32.5% is for car roads -#> • 39.9% is for parked cars, and -#> • 27.6% remains for everybody else. +#> • 39.7% is for parked cars, and +#> • 27.7% remains for everybody else. #> • There are street parking spaces for 7.8% of all residents. -#> • So 7.8% of residents occupy 39.9% of all space +#> • So 7.8% of residents occupy 39.7% of all space #> #> • Total proportion of public space: 11.7 #> • Total proportion of public space as superblock: 23.1 #> • Increase in public space as superblock: 97% ``` + +------------------------------------------------------------------------ + +### Analysis of parking times + +There is also a function to estimate how long it takes to find car park +as a function of the proportion of available car parking spaces. The +results are compared to equivalent times to drive to the nearest large +parking facility (“garage” in the graph below), to park a car, and then +walk back to the place of residence. + + + +``` r +times <- sb_parking_times (osmdat) +plot (times) +``` + +The results shows how long it takes to find a parking space for an +average attempt (“park(50%)”), for one out of every four attempts +(“park(75%)”), and for one out of every ten attempts (“park(90%)”). +Above around 97-98% occupancy, which is the general state most nights, +an “average” attempt may still take under 5 minutes, yet one out of four +times will take 10 minutes or more, and one out of ten times it will +take more than half an hour. The horizontal lines shows the time it +would take on average for all residents of the area to drive directly to +a nearby large parking facility (“garage”), park, and walk back. Beyond +around 95% occupancy, it is always quicker to park in a garage and walk +back. diff --git a/codemeta.json b/codemeta.json index 8339042..000ee59 100644 --- a/codemeta.json +++ b/codemeta.json @@ -7,7 +7,7 @@ "codeRepository": "https://github.com/UrbanAnalyst/superblock-ms", "issueTracker": "https://github.com/UrbanAnalyst/superblock-ms/issues", "license": "https://spdx.org/licenses/GPL-3.0", - "version": "0.1.0.108", + "version": "0.1.0.110", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", diff --git a/man/figures/README-parking-times-1.png b/man/figures/README-parking-times-1.png new file mode 100644 index 0000000..4a1f18b Binary files /dev/null and b/man/figures/README-parking-times-1.png differ