Running 'deprivation-profile-simple.R' [163s]
  Running 'deprivation-profile.R' [160s]
  Running 'testthat.R' [174s]
Running the tests in 'tests/deprivation-profile-simple.R' failed.
Complete output:
  > library(mpindex)
  > 
  > indicators <- data.frame(
  +   dimension = c("A", "B"),
  +   indicator = c("A1", "A2", "B1", "B2"),
  +   variable = c("a1", "a2", "b1", "b2"),
  +   weight = rep(1 / 4, 4)
  + )
  > 
  > specs_simple <- define_mpi_specs(
  +   .poverty_cutoffs = 1 / 2,
  +   .indicators = indicators
  + )
  > 
  > df_simple <- data.frame(
  +   a1 = c(0, 1, 1, 0),
  +   a2 = c(0, 0, 1, 1),
  +   b1 = c(0, 0, 1, 0),
  +   b2 = c(0, 1, 1, 0)
  + )
  > 
  > dp_simple <- list()
  > dp_simple$a1 <- df_simple |>
  +   define_deprivation(a1, a1 == 1, .mpi_specs = specs_simple)
  > dp_simple$a2 <- df_simple |>
  +   define_deprivation(a2, a2 == 1, .mpi_specs = specs_simple)
  > dp_simple$b1 <- df_simple |>
  +   define_deprivation(b1, b1 == 1, .mpi_specs = specs_simple)
  > dp_simple$b2 <- df_simple |>
  +   define_deprivation(b2, b2 == 1, .mpi_specs = specs_simple)
  > 
  > 
  > proc.time()
     user  system elapsed 
     0.79    0.29    1.04 
Running the tests in 'tests/deprivation-profile.R' failed.
Complete output:
  > library(mpindex)
  > 
  > mpi_specs <- use_global_mpi_specs(.uid = "uuid")
  > attr_spec <- attributes(mpi_specs)
  > deprivation_profile <- list()
  > 
  > deprivation_profile$nutrition <- df_household_roster |>
  +   define_deprivation(
  +     .indicator = nutrition,
  +     .cutoff = undernourished == 1 & age < 70,
  +     .collapse = TRUE,
  +     .mpi_specs = mpi_specs
  +   )
  > 
  > deprivation_profile$child_mortality <- df_household |>
  +   define_deprivation(
  +     .indicator = child_mortality,
  +     .cutoff = with_child_died == 1,
  +     .mpi_specs = mpi_specs
  +   )
  > 
  > deprivation_profile$year_schooling <- df_household_roster |>
  +   define_deprivation(
  +     .indicator = year_schooling,
  +     .cutoff = completed_6yrs_schooling == 2,
  +     .collapse = TRUE,
  +     .mpi_specs = mpi_specs
  +   )
  > 
  > deprivation_profile$school_attendance <- df_household_roster |>
  +   define_deprivation(
  +     .indicator = school_attendance,
  +     .cutoff = attending_school == 2 & age %in% c(5:24),
  +     .collapse = TRUE,
  +     .mpi_specs = mpi_specs
  +   )
  > 
  > deprivation_profile$cooking_fuel <- df_household |>
  +   define_deprivation(
  +     .indicator = cooking_fuel,
  +     .cutoff = cooking_fuel %in% c(4:6, 9),
  +     .mpi_specs = mpi_specs
  +   )
  > 
  > deprivation_profile$sanitation <- df_household |>
  +   define_deprivation(
  +     .indicator = sanitation,
  +     .cutoff = toilet > 1,
  +     .mpi_specs = mpi_specs
  +   )
  > 
  > deprivation_profile$drinking_water <- df_household |>
  +   define_deprivation(
  +     .indicator = drinking_water,
  +     .cutoff = drinking_water == 2,
  +     .mpi_specs = mpi_specs
  +   )
  > 
  > deprivation_profile$electricity <- df_household |>
  +   define_deprivation(
  +     .indicator = electricity,
  +     .cutoff = electricity == 2,
  +     .mpi_specs = mpi_specs
  +   )
  > 
  > deprivation_profile$housing <- df_household |>
  +   define_deprivation(
  +     .indicator = housing,
  +     .cutoff = roof %in% c(5, 7, 9) | walls %in% c(5, 8, 9, 99) == 2 | floor %in% c(5, 6, 9),
  +     .mpi_specs = mpi_specs
  +   )
  > 
  > 
  > deprivation_profile$assets <- df_household |>
  +   dplyr::mutate_at(
  +     dplyr::vars(dplyr::starts_with("asset_")),
  +     ~ dplyr::if_else(. > 0, 1L, 0L)
  +   ) |>
  +   dplyr::mutate(
  +     asset_phone = dplyr::if_else(
  +       (asset_telephone + asset_mobile_phone) > 0,
  +       1L,
  +       0L
  +     )
  +   ) |>
  +   dplyr::mutate(
  +     with_hh_conveniences = (asset_tv + asset_phone + asset_computer +
  +       asset_animal_cart + asset_bicycle +
  +       asset_motorcycle + asset_refrigerator) > 1,
  +     with_mobility_assets = (asset_car + asset_truck) > 0
  +   ) |>
  +   define_deprivation(
  +     .indicator = assets,
  +     .cutoff = !(with_hh_conveniences & with_mobility_assets),
  +     .mpi_specs = mpi_specs
  +   )
  > 
  > proc.time()
     user  system elapsed 
     1.06    0.21    1.26 
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
  > # * https://testthat.r-lib.org/articles/special-files.html
  > 
  > library(testthat)
  > library(mpindex)
  > 
  > test_check("mpindex")
  [ FAIL 0 | WARN 0 | SKIP 0 | PASS 128 ]
  > 
  > proc.time()
     user  system elapsed 
     5.84    0.39    6.21