Skip to content

Commit

Permalink
logistics
Browse files Browse the repository at this point in the history
  • Loading branch information
CoryMcCartan committed Jun 20, 2022
1 parent fda5f4b commit 5ec4c26
Show file tree
Hide file tree
Showing 11 changed files with 121 additions and 607 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
^pkgdown$
^\.github$
^README\.Rmd$
^cran-comments\.md$
^data-raw$
49 changes: 49 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +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]
pull_request:
branches: [main, master]

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
19 changes: 12 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,21 @@ Authors@R: c(
person("Cory", "McCartan", email = "[email protected]", role = "aut"),
person("Christopher T.", "Kenny", email = "[email protected]", role = c("aut", "cre")))
Description: What the package does (one paragraph).
License: GPL (>= 3)
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.2
Depends:
R (>= 2.10)
Imports:
ggplot2,
scales
URL: https://github.com/alarm-redist/ggredist,
https://alarm-redist.github.io/ggredist
BugReports: https://github.com/alarm-redist/ggredist/issues
Suggests:
sf,
redist,
testthat (>= 3.0.0)
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.2
URL: https://github.com/alarm-redist/ggredist,
https://alarm-redist.github.io/ggredist/
BugReports: https://github.com/alarm-redist/ggredist/issues
Config/testthat/edition: 3
LazyData: true
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
YEAR: 2022
COPYRIGHT HOLDER: Cory McCartan and Christopher T. Kenny
616 changes: 21 additions & 595 deletions LICENSE.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ knitr::opts_chunk$set(
# ggredist

<!-- badges: start -->
[![R-CMD-check](https://github.com/alarm-redist/ggredist/workflows/R-CMD-check/badge.svg)](https://github.com/alarm-redist/ggredist/actions)
[![R-CMD-check](https://github.com/alarm-redist/ggredist/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/alarm-redist/ggredist/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

`ggredist` provides `ggplot2` extensions for political map making.
`ggredist` provides `ggplot2` extensions for political mapmaking.

## Installation

You can install the development version of ggredist from [GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
devtools::install_github("alarm-redist/ggredist")
# install.packages("remotes")
remotes::install_github("alarm-redist/ggredist")
```

## Example
Expand Down
3 changes: 2 additions & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
url: https://alarm-redist.github.io/ggredist
url: https://alarm-redist.github.io/ggredist/
template:
bootstrap: 5
bootswatch: yeti

5 changes: 5 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## R CMD check results

0 errors | 0 warnings | 1 note

* This is a new release.
23 changes: 23 additions & 0 deletions data-raw/oregon.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
library(alarmdata)
library(redist)
library(sf)
library(dplyr)
library(stringr)

or_map = alarm_50state_map("OR")

oregon = or_map %>%
as_tibble() %>%
st_as_sf() %>%
filter(area_water / (area_land + area_water) < 0.95) %>%
`attr<-`("analysis_name", NULL) %>%
`attr<-`("pop_col", NULL) %>%
`attr<-`("adj_col", NULL) %>%
`attr<-`("existing_col", NULL) %>%
`attr<-`("pop_bounds", NULL) %>%
mutate(across(pop:pop_black, as.integer),
tract = str_sub(GEOID, 3)) %>%
select(GEOID, county, cd_2020, pop, pop_white, ndv, nrv, geometry) %>%
rmapshaper::ms_simplify(keep=0.03, weighting=0.5, keep_shapes=TRUE)

usethis::use_data(oregon, overwrite = TRUE, compress="xz")
Binary file added data/oregon.rda
Binary file not shown.
1 change: 1 addition & 0 deletions ggredist.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ LineEndingConversion: Posix

BuildType: Package
PackageUseDevtools: Yes
PackageCleanBeforeInstall: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,collate,namespace

0 comments on commit 5ec4c26

Please sign in to comment.