idblr / ndi

Computes various geospatial indices of socioeconomic deprivation and disparity in the United States
Apache License 2.0
21 stars 1 forks source link

ndi version 0.1.3 reverse dependency check failure when CENSUS_API_KEY not "" #5

Closed rsbivand closed 1 year ago

rsbivand commented 1 year ago

00check.log testthat.Rout.zip

If Sys.getenv("CENSUS_API_KEY") != ""`, the tests are not skipped, and are not silent:

> nzchar(Sys.getenv("CENSUS_API_KEY"))
[1] TRUE
> anthopolos(state = "DC", year = 2020, subgroup = c("NHoLB", "HoLB"))
  |======================================================================| 100%
$ri
# A tibble: 206 × 8
   GEOID       state                county      tract     RI Total…¹ NHoLB  HoLB
   <chr>       <chr>                <chr>       <chr>  <dbl>   <dbl> <dbl> <dbl>
 1 11001000101 District of Columbia District o… 1.01  0.0390    1250     0     0
 2 11001000102 District of Columbia District o… 1.02  0.0413    3318    34     0
 3 11001000201 District of Columbia District o… 2.01  0.0457    3972   239     8
 4 11001000202 District of Columbia District o… 2.02  0.0371    4665   131    11
 5 11001000300 District of Columbia District o… 3     0.0536    6504   178     0
 6 11001000400 District of Columbia District o… 4     0.0495    1481    32     0
 7 11001000501 District of Columbia District o… 5.01  0.101     3343   233     0
 8 11001000502 District of Columbia District o… 5.02  0.0616    3580   150    20
 9 11001000600 District of Columbia District o… 6     0.0749    4942   411     0
10 11001000702 District of Columbia District o… 7.02  0.0763    2971   335     0
# … with 196 more rows, and abbreviated variable name ¹​TotalPop
# ℹ Use `print(n = ...)` to see more rows

$missing
# A tibble: 3 × 4
  variable total n_missing percent_missing
  <chr>    <int>     <int> <chr>          
1 HoLB       206         0 0 %            
2 NHoLB      206         0 0 %            
3 TotalPop   206         0 0 %            

> bravo(state = "DC", year = 2009, subgroup = c("LtHS", "HSGiE"))
  |======================================================================| 100%
$ei
# A tibble: 188 × 24
   GEOID   state county tract     EI Total…¹  mNSC mNt4G m5t6G m7t8G   m9G  m10G
   <chr>   <chr> <chr>  <chr>  <dbl>   <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
 1 110010… Dist… Distr… 1     0.0524    3882     0     0     0     0     0     0
 2 110010… Dist… Distr… 2.01  0.0522     127     0     0     0     0     0     0
 3 110010… Dist… Distr… 2.02  0.0442    2371     0     0     0     0     0     0
 4 110010… Dist… Distr… 3     0.0732    3563     0     0     0     0     0     0
 5 110010… Dist… Distr… 4     0.0832    1099     0     0     0     0     0     0
 6 110010… Dist… Distr… 5.01  0.0809    2426     0     0     0     0     0     0
 7 110010… Dist… Distr… 5.02  0.0942    2471     0     0     7     0     0     0
 8 110010… Dist… Distr… 6     0.104     4436    10     0     8    37     0   146
 9 110010… Dist… Distr… 7.01  0.114     3782     0     0     0     0    26     0
10 110010… Dist… Distr… 7.02  0.0805    2237     0     0     0    33     0     0
# … with 178 more rows, 12 more variables: m11G <dbl>, m12GND <dbl>,
#   mHSGGEDoA <dbl>, fNSC <dbl>, fNt4G <dbl>, f5t6G <dbl>, f7t8G <dbl>,
#   f9G <dbl>, f10G <dbl>, f11G <dbl>, f12GND <dbl>, fHSGGEDoA <dbl>, and
#   abbreviated variable name ¹​TotalPop
# ℹ Use `print(n = ...)` to see more rows, and `colnames()` to see all variable names

$missing
# A tibble: 19 × 4
   variable  total n_missing percent_missing
   <chr>     <int>     <int> <chr>          
 1 f10G        188         0 0 %            
 2 f11G        188         0 0 %            
 3 f12GND      188         0 0 %            
 4 f5t6G       188         0 0 %            
 5 f7t8G       188         0 0 %            
 6 f9G         188         0 0 %            
 7 fHSGGEDoA   188         0 0 %            
 8 fNSC        188         0 0 %            
 9 fNt4G       188         0 0 %            
10 m10G        188         0 0 %            
11 m11G        188         0 0 %            
12 m12GND      188         0 0 %            
13 m5t6G       188         0 0 %            
14 m7t8G       188         0 0 %            
15 m9G         188         0 0 %            
16 mHSGGEDoA   188         0 0 %            
17 mNSC        188         0 0 %            
18 mNt4G       188         0 0 %            
19 TotalPop    188         0 0 %            
idblr commented 1 year ago

Hi @rsbivand, thank you for the heads up.

I updated the tests for anthopolos() and bravo() when quiet = FALSE to expect output and not silent. R CMD check results are clean when Sys.getenv("CENSUS_API_KEY") != "". I have released these updates in a new branch (ndi v0.1.4.9000). Please let me know if the updates works for you, and then I'll resubmit them to CRAN.

rsbivand commented 1 year ago

The new branch looks OK:

00check.log

idblr commented 1 year ago

Thank you, @rsbivand. I merge with main and submit to CRAN.