Skip to content

Commit 1253e5a

Browse files
committed
Remove as_sf deprecation warnings
1 parent 5d39e8d commit 1253e5a

4 files changed

Lines changed: 3 additions & 24 deletions

File tree

R/fips-data.R

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#' @param regions The region breakdown for the map, can be one of
44
#' (\code{"states"}, \code{"state"}, \code{"counties"}, \code{"county"}).
55
#' The default is \code{"states"}.
6-
#' @param as_sf DEPRECATED. This parameter has no effect and will be removed in
6+
#' @param as_sf Defunct, this parameter no longer has any effect and will be removed in
77
#' the future.
88
#'
99
#' @return An data frame of FIPS codes of the desired \code{regions}.
@@ -21,10 +21,6 @@ fips_data <- function(
2121
) {
2222
regions <- match.arg(regions)
2323

24-
if (!missing("as_sf"))
25-
warning("`as_sf` is deprecated and no longer has any effect, all data is
26-
returned as an `sf` object.")
27-
2824
map_data <- usmapdata::us_map(regions)
2925
sf::st_geometry(map_data) <- NULL
3026
map_data

R/us-map.R

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#' same name. The regions listed in the \code{include} parameter are applied first and the
1515
#' \code{exclude} regions are then removed from the resulting map. Any excluded regions
1616
#' not present in the included regions will be ignored.
17-
#' @param as_sf DEPRECATED. This parameter has no effect and will be removed in
17+
#' @param as_sf Defunct, this parameter no longer has any effect and will be removed in
1818
#' the future.
1919
#'
2020
#' @return An `sf` data frame of US map coordinates divided by the desired \code{regions}.
@@ -36,10 +36,6 @@ us_map <- function(
3636
) {
3737
regions <- match.arg(regions)
3838

39-
if (!missing("as_sf"))
40-
warning("`as_sf` is deprecated and no longer has any effect, all data is
41-
returned as an `sf` object.")
42-
4339
if (regions == "state") regions <- "states"
4440
else if (regions == "county") regions <- "counties"
4541

@@ -70,7 +66,7 @@ us_map <- function(
7066
#' @param regions The region breakdown for the map, can be one of
7167
#' (\code{"states"}, \code{"counties"}, as specified by the internal file names.
7268
#' The default is \code{"states"}.
73-
#' @param as_sf DEPRECATED. This parameter has no effect and will be removed in
69+
#' @param as_sf Defunct, this parameter no longer has any effect and will be removed in
7470
#' the future.
7571
#'
7672
#' @return An `sf` data frame of state or county centroid labels and positions
@@ -83,10 +79,6 @@ centroid_labels <- function(
8379
) {
8480
regions <- match.arg(regions)
8581

86-
if (!missing("as_sf"))
87-
warning("`as_sf` is deprecated and no longer has any effect, all data is
88-
returned as an `sf` object.")
89-
9082
sf::read_sf(
9183
system.file("extdata", paste0("us_", regions, "_centroids.gpkg"),
9284
package = "usmapdata")

tests/testthat/test-fips-data.R

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,3 @@ test_that("county FIPS codes load correctly", {
3939
expect_equal(county_fips[[3144, "county"]], "Weston County")
4040
expect_equal(county_fips[[3144, "fips"]], "56045")
4141
})
42-
43-
test_that("as_sf deprecation warning occurs", {
44-
expect_warning(fips_data(as_sf = TRUE))
45-
})

tests/testthat/test-usmap.R

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,3 @@ test_that("centroid labels are loaded", {
7474
expect_equal(length(centroid_labels("states")[[1]]), 51)
7575
expect_equal(length(centroid_labels("counties")[[1]]), 3144)
7676
})
77-
78-
test_that("as_sf deprecation warning occurs", {
79-
expect_warning(us_map(as_sf = TRUE))
80-
expect_warning(centroid_labels(as_sf = TRUE))
81-
})

0 commit comments

Comments
 (0)