Skip to content

Commit 7f7599f

Browse files
committed
remove data quality flags functionality, it won't work with the data on the server
1 parent 375031e commit 7f7599f

6 files changed

Lines changed: 1 addition & 78 deletions

File tree

NEWS.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929

3030
- Improvements in warnings and messages
3131
- Removal of stale code
32-
- Optionally retain original NA data types and emit warning when data quality is poor
3332
- Download progress reporting and retry logic for robustness against network issues
3433

3534
# cancensus 0.5.10

R/cancensus.R

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@
2020
#' @param use_cache If set to TRUE (the default) data will be read from the local cache if available.
2121
#' @param quiet When TRUE, suppress messages and warnings.
2222
#' @param api_key An API key for the CensusMapper API. Defaults to \code{options()} and then the \code{CM_API_KEY} environment variable.
23-
#' @param preserve_suppression_flags Logical. If TRUE, creates additional columns with suffix \code{_flag}
24-
#' for each census vector variable, containing the original suppression codes (e.g., 'x', 'F', '...')
25-
#' before they are converted to NA. Useful for understanding data quality and suppression patterns.
26-
#' Default is FALSE. Use \code{\link{census_data_quality}} to analyze suppression patterns.
2723
#' @param retry Integer If greater than zero, automatically retry failed API requests with exponential backoff for specified maximum number of times. Defaults to 0.
2824
#'
2925
#' @source Census data and boundary geographies are reproduced and distributed on
@@ -57,7 +53,6 @@ get_census <- function (dataset, regions, level=NA, vectors=c(), geo_format = NA
5753
resolution = 'simplified',
5854
labels = "detailed",
5955
use_cache=TRUE, quiet=FALSE, api_key=Sys.getenv("CM_API_KEY"),
60-
preserve_suppression_flags=FALSE,
6156
retry=0) {
6257

6358
# API and data recall checks
@@ -184,7 +179,7 @@ get_census <- function (dataset, regions, level=NA, vectors=c(), geo_format = NA
184179
# Use readr::read_csv if it's available.
185180
# When preserving suppression flags, don't convert na_strings to NA yet
186181
httr::content(response, type = "text", encoding = "UTF-8") %>%
187-
readr::read_csv(na = if (preserve_suppression_flags) character() else cancensus_na_strings,
182+
readr::read_csv(na = cancensus_na_strings,
188183
col_types = list(.default = "c"))
189184
} else {
190185
check_recalled_data_and_warn(meta_file,params)
@@ -194,11 +189,6 @@ get_census <- function (dataset, regions, level=NA, vectors=c(), geo_format = NA
194189
dplyr::as_tibble(.name_repair = "minimal")
195190
}
196191

197-
# Create suppression flag columns before converting to numeric
198-
if (preserve_suppression_flags) {
199-
result <- create_suppression_flags(result, cancensus_na_strings)
200-
}
201-
202192
result <- result %>%
203193
dplyr::mutate_at(c(dplyr::intersect(names(.),c("Population","Households","Dwellings","Area (sq km)")),
204194
names(.)[grepl("^v_",names(.)) & !grepl("_flag$",names(.))]), as.num) %>%

cran-comments.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929

3030
- Improvements in warnings and messages
3131
- Removal of stale code
32-
- Optionally retain original NA data types and emit warning when data quality is poor
3332
- Download progress reporting and retry logic for robustness against network issues
3433

3534
# cancensus 0.5.10

man/census_data_quality.Rd

Lines changed: 0 additions & 58 deletions
This file was deleted.

man/get_census.Rd

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkgdown/_pkgdown.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ reference:
3030
- child_census_vectors
3131
- parent_census_vectors
3232
- visualize_vector_hierarchy
33-
- census_data_quality
3433
- dataset_attribution
3534
- title: Managing cached data
3635
- contents:

0 commit comments

Comments
 (0)