Skip to content

as_model_out_tbl() requires library(hubUtils) in the environment to work #96

@LucieContamin

Description

@LucieContamin

The function hubUtils::as_model_out_tbl() seems to require to have the complete hubUtils package load in the environment to work.

For example, with df being a tibble of model output data:

> hubUtils::as_model_out_tbl(df)
Error in `[.tbl_df`(tbl, , c(std_colnames[1], names(tbl)[!names(tbl) %in%  : 
  object 'std_colnames' not found
> library(hubUtils)
> hubUtils::as_model_out_tbl(df)
# A tibble: 336,000 × 10
   model_id     origin_date scenario_id  location target    horizon race_ethnicity output_type output_type_id value
 * <chr>        <date>      <chr>        <chr>    <chr>       <int> <chr>          <chr>                <dbl> <dbl>
 1 team1_modela 2023-09-01  A-2023-09-01 06       inc death       1 asian          sample                   1   538
 2 team1_modela 2023-09-01  A-2023-09-01 37       inc death       1 asian          sample                   1   621
 3 team1_modela 2023-09-01  A-2023-09-01 06       inc case        1 asian          sample                   1  1760
 4 team1_modela 2023-09-01  A-2023-09-01 37       inc case        1 asian          sample                   1  1164
 5 team1_modela 2023-09-01  A-2023-09-01 06       inc death       2 asian          sample                   1   448
 6 team1_modela 2023-09-01  A-2023-09-01 37       inc death       2 asian          sample                   1   553
 7 team1_modela 2023-09-01  A-2023-09-01 06       inc case        2 asian          sample                   1  4229
 8 team1_modela 2023-09-01  A-2023-09-01 37       inc case        2 asian          sample                   1  1333
 9 team1_modela 2023-09-01  A-2023-09-01 06       inc death       3 asian          sample                   1   630
10 team1_modela 2023-09-01  A-2023-09-01 37       inc death       3 asian          sample                   1   728
# ℹ 335,990 more rows
# ℹ Use `print(n = ...)` to see more rows

Should we change that behavior to have the function working without having to load the complete package?

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions