diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index e809466..bfc9f4d 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -1,50 +1,49 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: - branches: - - main - - master - tags: - -'*' + branches: [main, master] + pull_request: + release: + types: [published] + workflow_dispatch: -name: pkgdown +name: pkgdown.yaml + +permissions: read-all jobs: pkgdown: - runs-on: macOS-latest + runs-on: ubuntu-latest + # Only restrict concurrency for non-PR jobs + concurrency: + group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write steps: - - uses: actions/checkout@v2 - - - uses: r-lib/actions/setup-r@v1 + - uses: actions/checkout@v4 - - uses: r-lib/actions/setup-pandoc@v1 + - uses: r-lib/actions/setup-pandoc@v2 - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") - shell: Rscript {0} + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true - - name: Restore R package cache - uses: actions/cache@v2 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- - - - name: Install dependencies - run: | - remotes::install_deps(dependencies = TRUE) - install.packages("pkgdown", type = "binary") - shell: Rscript {0} + extra-packages: any::pkgdown, local::. + needs: website - - name: Install package - run: R CMD INSTALL . + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) + shell: Rscript {0} - - name: Deploy package - run: | - git config --local user.email "actions@github.com" - git config --local user.name "GitHub Actions" - Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)' + - name: Deploy to GitHub pages 🚀 + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4.5.0 + with: + clean: false + branch: gh-pages + folder: docs diff --git a/DESCRIPTION b/DESCRIPTION index 9481212..de4c436 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -14,14 +14,16 @@ Authors@R: Description: Functions, documentation and example data to help divide geographic space into discrete polygons (zones). The package supports new zoning systems that are documented in the - accompanying paper . + accompanying paper, + "ClockBoard: A zoning system for urban analysis", + by Lovelace et al. (2022) . The functions are motivated by research into the merits of different zoning systems - . A flexible 'ClockBoard' zoning system is + (Openshaw, 1977) . A flexible ClockBoard zoning system is provided, which breaks-up space by concentric rings and radial lines emanating from a central point. - By default, the diameter of the rings grow according the triangular number sequence - with the first 4 'doughnuts' - (or 'annuli') measuring 1, 3, 6, and 10 km wide. + By default, the diameter of the rings grow according to the triangular number sequence + (Ross & Knott, 2019) with the first 4 doughnuts + (or annuli) measuring 1, 3, 6, and 10 km wide. These annuli are subdivided into equal segments (12 by default), creating the visual impression of a dartboard. Zones are labelled according to distance to the centre and angular distance from North, creating a simple diff --git a/cran-comments.md b/cran-comments.md index 5f2ecd3..e979bc1 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,6 +1,6 @@ Many updates enabling tests to pass on CRAN, after the package was removed due to failing tests. -I have fixed broken URLs since last submission. +I have made fixes (to DESCRIPTION and package size) to address the issues raised by CRAN. ## Test environments * local R installation, R 4.1.0 diff --git a/vignettes/paper.Rmd b/vignettes/paper.Rmd index 2d63c0e..de40837 100644 --- a/vignettes/paper.Rmd +++ b/vignettes/paper.Rmd @@ -101,6 +101,10 @@ remotes::install_github("paleolimbot/rbbt") # rbbt::bbt_update_bib(path_rmd = "vignettes/paper.Rmd") ``` +# Published paper + +**Note: this is a fully reproducible version of the paper "ClockBoard: a zoning system for urban analysis" by @lovelace_clockboard_2022 published in the Journal of Open Source Software. The paper is available at [doi:10.5311/JOSIS.2022.24.172](https://doi.org/10.5311/JOSIS.2022.24.172).** + # Introduction Zoning systems have long been used for a variety of administrative and practical purposes. @@ -331,6 +335,7 @@ zb_view(ClockBoard_tokyo, alpha = 0.8) # pngquant -f --ext .png --quality 60-85 vignettes/tokyo.png knitr::include_graphics("https://user-images.githubusercontent.com/1825120/128613050-96fd8882-10c5-47d8-af2f-90fceeba8d81.png") # LaTeX version: +# 856 KB # download.file("https://user-images.githubusercontent.com/1825120/128613050-96fd8882-10c5-47d8-af2f-90fceeba8d81.png", "tokyo.png") # knitr::include_graphics("tokyo.png") ``` @@ -372,6 +377,8 @@ To enable creation of ClockBoard zones for non-programmers and to encourage peop # See https://github.com/zonebuilders/zonebuilder-rust/issues/42#issuecomment-886627851 u = "https://user-images.githubusercontent.com/1825120/128508694-5b5485ca-6f1b-4c21-bdb6-9269a7981dd5.png" +# 779 KB +# download.file(u, "interactive.png") # for html version: knitr::include_graphics(u) @@ -420,6 +427,8 @@ Of course the locations are not geographically specific; the zones would be used # "navigation.png" # ) # knitr::include_graphics("navigation.png") +# 865 kb: +# download.file("https://user-images.githubusercontent.com/1825120/127722701-36ca3674-0522-40d6-9a69-e745ca628bca.png", "navigation.png") knitr::include_graphics("https://user-images.githubusercontent.com/1825120/127722701-36ca3674-0522-40d6-9a69-e745ca628bca.png") ``` @@ -455,6 +464,7 @@ This benefit is especially noticeable towards the outskirts of London, where lar u = "https://github.com/zonebuilders/zonebuilder/releases/download/v0.0.2.9000/cityscale.png" # f = basename(u) +# 155 kb # if(!file.exists(f)) download.file(url = u, destfile = f) # knitr::include_graphics(f) # for local high-res version, not working knitr::include_graphics(u) @@ -504,9 +514,9 @@ tm_shape(df_filtered, is.master = TRUE) + The results illustrated in Figure \@ref(fig:intercity) show that while London has a high absolute crash rate, it is relatively safe per km cycled. The ClockBoard zoning system also allows for aggregation at a consistent spatial resolution, enabling the identification of potential crash hotspots in specific parts of Birmingham (zones D12 and E06) and Sheffield (zone D11). -Another example of using ClockBoards to compare cities (and phenomena that take place in them) is shown in Figure \@ref(fig:popdens), which shows population density in 36 major cities using the ClockBoard zoning system not as unit for aggregation but as a reference grid. +Another example of using ClockBoards to compare cities (and phenomena that take place in them) is shown in Figure [9 in the published paper](https://josis.org/index.php/josis/article/view/172), which shows population density in 36 major cities using the ClockBoard zoning system not as unit for aggregation but as a reference grid. The 7 rings A to G cover a radius up to 28 km from the city centre. -The colors of the panel labels in Figure \@ref(fig:popdens) indicate the continent of the city. +The colors of the panel labels in Figure [9 in the published paper](https://josis.org/index.php/josis/article/view/172) indicate the continent of the city. The value of comparing cities in a single geographic frame of reference is shown by inspecting Singapore and Sydney with reference to ClockBoard zones. While these cities have similar total official populations (of 5.8 and 5.3 million people, respectively), based on the number of people with their respective administrative boundaries, the size and shape of each city is very different, highlighted by the fact that in Singapore there are few people beyond ring F (located 15 to 20 km from the centre), while in Sydney (and many other cities) there are substantial numbers of people living in ring I (located 36 to 45 km from the centre). @@ -516,11 +526,12 @@ While these cities have similar total official populations (of 5.8 and 5.3 milli -```{r popdens, fig.cap="ClockBoard for 36 cities. The blue raster grid cells represent open access population estimates from the WorldPop project.", out.width="100%"} -u = "https://github.com/zonebuilders/zonebuilder/releases/download/v0.0.2.9000/cities_p2.png" - +```{r popdens, fig.cap="ClockBoard for 36 cities. The blue raster grid cells represent open access population estimates from the WorldPop project.", out.width="100%", eval=FALSE} +# u = "https://github.com/zonebuilders/zonebuilder/releases/download/v0.0.2.9000/cities_p2.png" +# 2.1 MB +# download.file(u, "cities_p2.png") # For HTML version: -knitr::include_graphics(u) +# knitr::include_graphics(u) # # For LaTeX version # f = basename(u) @@ -528,7 +539,7 @@ knitr::include_graphics(u) # knitr::include_graphics(f) ``` -The administrative borders of six cities shown in Figure \@ref(fig:popdens) are depicted as red lines in Figure \@ref(fig:popdens2), highlighting the importance of sometimes arbitrary city boundaries. +The administrative borders of six cities shown in Figure [9 in the published paper](https://josis.org/index.php/josis/article/view/172) are depicted as red lines in Figure \@ref(fig:popdens2), highlighting the importance of sometimes arbitrary city boundaries. The ClockBoard zones applied to Amsterdam not only cover Amsterdam but also a few other small Dutch cities and towns. Most of them are economically attached to Amsterdam, but a few of them also to other major Dutch cites. The benefits of using a single zoning systems across multiple cities is highlighted by comparing London and Paris. @@ -539,7 +550,8 @@ The example highlights the utility of ClockBoard for communicating not only inte ```{r popdens2, fig.cap="ClockBoard for 6 cities with boundaries shown in red. The blue raster grid cells represent open access population estimates from the WorldPop project; the red lines are administrative borders.", out.width="70%"} u = "https://github.com/zonebuilders/zonebuilder/releases/download/v0.0.2.9000/cities_p1.png" - +# 1MB: +# download.file(u, "cities_p1.png") # For HTML version: knitr::include_graphics(u) diff --git a/vignettes/references.bib b/vignettes/references.bib index 1f5208c..0717ade 100644 --- a/vignettes/references.bib +++ b/vignettes/references.bib @@ -481,3 +481,21 @@ @Article{mindell_exposure-based_2012 keywords = {Age groups, Children, Death rates, England, Health statistics, Hospitals, Netherlands, Roads}, pages = {e50606}, } + +@article{lovelace_clockboard_2022, + title = {{{ClockBoard}}: {{A}} Zoning System for Urban Analysis}, + shorttitle = {{{ClockBoard}}}, + author = {Lovelace, Robin and Tennekes, Martijn and Carlino, Dustin}, + date = {2022-06-20}, + journaltitle = {Journal of Spatial Information Science}, + number = {24}, + pages = {63--85}, + issn = {1948-660X}, + doi = {10.5311/JOSIS.2022.24.172}, + url = {https://josis.org/index.php/josis/article/view/172}, + urldate = {2022-07-02}, + abstract = {Zones are the building blocks of urban analysis. Fields ranging from demographics to transport planning routinely use zones - spatially contiguous areal units that break-up continuous space into discrete chunks - as the foundation for diverse analysis techniques. Key methods such as origin-destination analysis and choropleth mapping rely on zones with appropriate sizes, shapes and coverage. However, existing zoning systems are sub-optimal in many urban analysis contexts, for three main reasons: 1) administrative zoning systems are often based on somewhat arbitrary factors; 2) zoning systems that are evidence-based (e.g., based on equal population size) are often highly variable in size and shape, reducing their utility for inter-city comparison; and 3) official zoning systems in many places simply do not exist or are unavailable. We set out to develop a flexible, open and scalable solution to these problems. The result is the zonebuilder project (with R, Rust and Python implementations), which was used to create the ClockBoard zoning system. ClockBoard consists of 12 segments emanating from a central place and divided by concentric rings with radii that increase in line with the triangular number sequence (1, 3, 6 km etc). 'ClockBoards' thus create a consistent visual frame of reference for monocentric cities that is reminiscent of clocks and a dartboard. This paper outlines the design and potential uses of the ClockBoard zoning system in the historical context, and discusses future avenues for research into the design and assessment of zoning systems.}, + issue = {24}, + langid = {english}, + keywords = {modifiable area unit problem}, +}