rOpenGov / geofi

R package for accessing Finnish geospatial data
https://ropengov.github.io/geofi/
Other
19 stars 6 forks source link

Fix issue #46 #47

Closed pitkant closed 10 months ago

pitkant commented 1 year ago

Fixes latter part of the issue described in #46 by making subsetting of columns less rigid in case of different column names between different years. What prompted this change was that sairaanhoitop_code column is missing from the most recent year 2023, which caused the following error in convert_municipality_key_codes function:

muns1 <- geofi::get_municipalities(codes_as_character = TRUE, year = 2023)

Error in `muni_key[, width_2]`:
! Can't subset columns that don't exist.
✖ Column `sairaanhoitop_code` doesn't exist.
codecov[bot] commented 1 year ago

Codecov Report

Merging #47 (0d6c4c7) into master (4173fd0) will decrease coverage by 2.67%. The diff coverage is 0.00%.

:exclamation: Current head 0d6c4c7 differs from pull request most recent head 983b99c. Consider uploading reports for the commit 983b99c to get more accurate results

@@            Coverage Diff             @@
##           master      #47      +/-   ##
==========================================
- Coverage   58.21%   55.55%   -2.67%     
==========================================
  Files           9        9              
  Lines         146      153       +7     
==========================================
  Hits           85       85              
- Misses         61       68       +7     
Impacted Files Coverage Δ
R/convert_codes_as_character.R 0.00% <0.00%> (ø)