Skip to content

Commit 851f672

Browse files
committed
1) Update and rebuild documentation.
2) Update tests for 2024. 3) Update MAX_YEAR to 2024
1 parent 3327fa0 commit 851f672

File tree

6 files changed

+39
-39
lines changed

6 files changed

+39
-39
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Imports:
1717
magrittr,
1818
purrr,
1919
stringr
20-
RoxygenNote: 7.2.1
20+
RoxygenNote: 7.3.2
2121
Suggests:
2222
testthat (>= 3.0.0),
2323
tibble

R/get_municipalities.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
MIN_YEAR <- 2000
2-
MAX_YEAR <- 2022
2+
MAX_YEAR <- 2024
33
YEARS <- MIN_YEAR:MAX_YEAR
44

55
#' Internal function get_municipalities_
@@ -43,7 +43,7 @@ get_municipalities_ <- function(year = MAX_YEAR, geoid_reference_year = year) {
4343
#' `geoid_ref_as_ref_column` is `TRUE`, in which case the reference
4444
#' year GEOID will be put in a separate column called `GEOID_ref`.
4545
#'
46-
#' @param year The year, from 2000 to 2022. The default is 2022.
46+
#' @param year The year, from 2000 to 2024. The default is 2024.
4747
#' @param geoid_year The year to use for GEOIDs
4848
#' @param geoid_ref_as_ref_column If TRUE, add a separate column for the reference GEOID
4949
#' @return A table with `GEOID`, `county` and `municipality`

README.Rmd

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ knitr::opts_chunk$set(
2020
<!-- badges: end -->
2121

2222
This is a data package for R that contains every county
23-
and municipality in New Jersey, from 2000 to 2022.
23+
and municipality in New Jersey, from 2000 to 2024.
2424

2525
## Installation
2626

@@ -31,9 +31,9 @@ You can install the development version of njmunicipalities from [GitHub](https:
3131
devtools::install_github("tor-gu/njmunicipalities")
3232
```
3333

34-
## Changes in NJ municipalites, 2000-2022
34+
## Changes in NJ municipalites, 2000-2024
3535

36-
Over the period 2000-2022, there have been several changes to
36+
Over the period 2000-2024, there have been several changes to
3737
the list of municipalities in New Jersey:
3838

3939
* In 2005, South Belmar became Lake Como. The US Census assigned
@@ -46,19 +46,19 @@ a new GEOID to Lake Como.
4646
* In 2022, Pine Valley was absorbed by Pine Hill.
4747

4848
This package will return municipality tables for any year from 2000 to
49-
2022, and provides tools for dealing the changes from year to year.
49+
2024, and provides tools for dealing the changes from year to year.
5050

5151
## Examples
5252
#### Get a table of municipalities
5353
Function `get_municipalities` returns a table of municipalities for a
54-
given year. The default is year 2022.
54+
given year. The default is year 2024.
5555
```{r}
5656
library(njmunicipalities)
5757
58-
# Municipality table for 2022
58+
# Municipality table for 2024
5959
get_municipalities() |> head(n=5)
6060
```
61-
If the year is specified (from 2000 to 2022), the table will reflect the names and US Census GEOIDs in effect for that year. Here is the list for 2007.
61+
If the year is specified (from 2000 to 2024), the table will reflect the names and US Census GEOIDs in effect for that year. Here is the list for 2007.
6262
```{r}
6363
# Municipality list for 2007
6464
get_municipalities(2007) |> head(n=5)

README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<!-- badges: end -->
1010

1111
This is a data package for R that contains every county and municipality
12-
in New Jersey, from 2000 to 2022.
12+
in New Jersey, from 2000 to 2024.
1313

1414
## Installation
1515

@@ -21,41 +21,41 @@ You can install the development version of njmunicipalities from
2121
devtools::install_github("tor-gu/njmunicipalities")
2222
```
2323

24-
## Changes in NJ municipalites, 2000-2022
24+
## Changes in NJ municipalites, 2000-2024
2525

26-
Over the period 2000-2022, there have been several changes to the list
26+
Over the period 2000-2024, there have been several changes to the list
2727
of municipalities in New Jersey:
2828

29-
- In 2005, South Belmar became Lake Como. The US Census assigned a new
30-
GEOID to Lake Como.
31-
- In 2007, Dover township in Ocean County became Toms River and was
32-
assigned a new GEOID.
33-
- In 2008, Washington township in Mercer County became Robbinsville
34-
township and was assigned a new GEOID.
35-
- In 2009, West Paterson became Woodland Park, and was assigned a new
36-
GEOID.
37-
- In 2010, Caldwell borough was assigned a new GEOID from the the US
38-
Census, though there was no name change at this time.
39-
- In 2013, Princeton borough and Princeton township merged. The merged
40-
municipality retained the Princeton borough GEOID, though the US
41-
Census started using the name ‘Princeton’ in place of ‘Princeton
42-
borough’ for the merged municipality.
43-
- In 2022, Pine Valley was absorbed by Pine Hill.
29+
- In 2005, South Belmar became Lake Como. The US Census assigned a new
30+
GEOID to Lake Como.
31+
- In 2007, Dover township in Ocean County became Toms River and was
32+
assigned a new GEOID.
33+
- In 2008, Washington township in Mercer County became Robbinsville
34+
township and was assigned a new GEOID.
35+
- In 2009, West Paterson became Woodland Park, and was assigned a new
36+
GEOID.
37+
- In 2010, Caldwell borough was assigned a new GEOID from the the US
38+
Census, though there was no name change at this time.
39+
- In 2013, Princeton borough and Princeton township merged. The merged
40+
municipality retained the Princeton borough GEOID, though the US
41+
Census started using the name ‘Princeton’ in place of ‘Princeton
42+
borough’ for the merged municipality.
43+
- In 2022, Pine Valley was absorbed by Pine Hill.
4444

4545
This package will return municipality tables for any year from 2000 to
46-
2022, and provides tools for dealing the changes from year to year.
46+
2024, and provides tools for dealing the changes from year to year.
4747

4848
## Examples
4949

5050
#### Get a table of municipalities
5151

5252
Function `get_municipalities` returns a table of municipalities for a
53-
given year. The default is year 2022.
53+
given year. The default is year 2024.
5454

5555
``` r
5656
library(njmunicipalities)
5757

58-
# Municipality table for 2022
58+
# Municipality table for 2024
5959
get_municipalities() |> head(n=5)
6060
#> # A tibble: 5 × 3
6161
#> GEOID county municipality
@@ -67,7 +67,7 @@ get_municipalities() |> head(n=5)
6767
#> 5 3400108710 Atlantic County Buena Vista township
6868
```
6969

70-
If the year is specified (from 2000 to 2022), the table will reflect the
70+
If the year is specified (from 2000 to 2024), the table will reflect the
7171
names and US Census GEOIDs in effect for that year. Here is the list for
7272
2007.
7373

@@ -135,7 +135,7 @@ dplyr::anti_join(
135135
get_municipalities(2005),
136136
get_municipalities(2004)
137137
)
138-
#> Joining, by = c("GEOID", "county", "municipality")
138+
#> Joining with `by = join_by(GEOID, county, municipality)`
139139
#> # A tibble: 1 × 3
140140
#> GEOID county municipality
141141
#> <chr> <chr> <chr>
@@ -154,7 +154,7 @@ get_municipalities(2005,
154154
dplyr::left_join(get_municipalities(2004),
155155
by = c("GEOID_ref" = "GEOID", "county"),
156156
suffix = c("", "_ref"))
157-
#> Joining, by = c("GEOID", "county", "municipality")
157+
#> Joining with `by = join_by(GEOID, county, municipality)`
158158
#> # A tibble: 1 × 5
159159
#> GEOID_ref GEOID county municipality municipality_ref
160160
#> <chr> <chr> <chr> <chr> <chr>

man/get_municipalities.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-get_municipalities.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
test_that("get_municipalities handles bad year", {
22
expect_error(get_municipalities(1999))
3-
expect_error(get_municipalities(2023))
3+
expect_error(get_municipalities(2025))
44
})
55

66
test_that("get_municipalities handles bad reference year", {
77
expect_error(get_municipalities(2010, 1999))
8-
expect_error(get_municipalities(2010, 2023))
8+
expect_error(get_municipalities(2010, 2025))
99
})
1010

1111

@@ -145,12 +145,12 @@ test_that("get_municipalities handles geoid_ref_as_ref_column", {
145145

146146
test_that("get_geoid_cross_references handles bad years", {
147147
expect_error(get_geoid_cross_references(2000, 1999:2021))
148-
expect_error(get_geoid_cross_references(2000, 2000:2023))
148+
expect_error(get_geoid_cross_references(2000, 2000:2025))
149149
})
150150

151151
test_that("get_geoid_cross_references handles bad reference year", {
152152
expect_error(get_geoid_cross_references(1999, 2010))
153-
expect_error(get_geoid_cross_references(2023, 2010))
153+
expect_error(get_geoid_cross_references(2025, 2010))
154154
})
155155

156156

0 commit comments

Comments
 (0)