timriffe / ODAPbackend

Other
0 stars 2 forks source link

lt_flexible error #33

Open cimentadaj opened 2 hours ago

cimentadaj commented 2 hours ago

@TTRustam @timriffe some random error with this reproduce_error file

data_in <- readr::read_csv("~/Downloads/reproduce_error.csv")

data_in <-
  data_in %>%
  filter(.id == 4)

data_in %>%
  lt_flexible(
  OAnew = 100,
  age_out = "single",
  extrapFrom = 80,
  extrapFit = seq(60, 100, by = 5),
  extrapLaw = "Kannisto",
  radix = 100000,
  SRB = 1.05,
  a0rule = "Andreev-Kingkade",
  axmethod = "UN (Greville)",
  Sex = "Total"
)
Error in `reframe()` at ODAPbackend/R/lifetables.R:88:3:
ℹ In argument: `lt_flexible_chunk(...)`.
ℹ In group 1: `.id = 4`.
Caused by error in `if (any(ind)) ...`:
! missing value where TRUE/FALSE needed
Run `rlang::last_trace()` to see where the error occurred.
timriffe commented 2 hours ago

my guess this is because we still need to integrate passing group_vars to the function; probably the Sex column was simply not available to lt_flexible()? @TTRustam, can you troubleshoot this?

On Thu, Oct 24, 2024 at 4:25 PM Jorge Cimentada @.***> wrote:

@TTRustam https://github.com/TTRustam @timriffe https://github.com/timriffe some random error with this reproduce_error file https://github.com/user-attachments/files/17508499/reproduce_error.csv

data_in <- readr::read_csv("~/Downloads/reproduce_error.csv") data_in <- data_in %>% filter(.id == 4) data_in %>% lt_flexible( OAnew = 100, age_out = "single", extrapFrom = 80, extrapFit = seq(60, 100, by = 5), extrapLaw = "Kannisto", radix = 100000, SRB = 1.05, a0rule = "Andreev-Kingkade", axmethod = "UN (Greville)", Sex = "Total" )

Error in reframe() at ODAPbackend/R/lifetables.R:88:3: ℹ In argument: lt_flexible_chunk(...). ℹ In group 1: .id = 4. Caused by error in if (any(ind)) ...: ! missing value where TRUE/FALSE needed Run rlang::last_trace() to see where the error occurred.

— Reply to this email directly, view it on GitHub https://github.com/timriffe/ODAPbackend/issues/33, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG43G3E2E5UA2UI4MD4EVTZ5D7O3AVCNFSM6AAAAABQRHGLJOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGYYTCNZXGI4TMMY . You are receiving this because you were mentioned.Message ID: @.***>

TTRustam commented 1 hour ago

Good afternoon everyone.

Well, this question partly intersects with the second one: 1) Use data directly rather than pipe 2) Columns to be used as groups However in this is not a problem of lt_flexible, it is the DemoToola function that gives this error, look: data_in <- data_in %>% filter(.id == 4) lt_abridged2single(Deaths = data_in$Deaths, Exposures = data_in$Exposures, Age = data_in$Age) I don't know why this happens. Maybe we can take a look at this together with Tim?

Best regards, Rustam.

чт, 24 окт. 2024 г. в 16:34, Tim Riffe @.***>:

my guess this is because we still need to integrate passing group_vars to the function; probably the Sex column was simply not available to lt_flexible()? @TTRustam, can you troubleshoot this?

On Thu, Oct 24, 2024 at 4:25 PM Jorge Cimentada @.***> wrote:

@TTRustam https://github.com/TTRustam @timriffe https://github.com/timriffe some random error with this reproduce_error file https://github.com/user-attachments/files/17508499/reproduce_error.csv

data_in <- readr::read_csv("~/Downloads/reproduce_error.csv") data_in <- data_in %>% filter(.id == 4) data_in %>% lt_flexible( OAnew = 100, age_out = "single", extrapFrom = 80, extrapFit = seq(60, 100, by = 5), extrapLaw = "Kannisto", radix = 100000, SRB = 1.05, a0rule = "Andreev-Kingkade", axmethod = "UN (Greville)", Sex = "Total" )

Error in reframe() at ODAPbackend/R/lifetables.R:88:3: ℹ In argument: lt_flexible_chunk(...). ℹ In group 1: .id = 4. Caused by error in if (any(ind)) ...: ! missing value where TRUE/FALSE needed Run rlang::last_trace() to see where the error occurred.

— Reply to this email directly, view it on GitHub https://github.com/timriffe/ODAPbackend/issues/33, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AAG43G3E2E5UA2UI4MD4EVTZ5D7O3AVCNFSM6AAAAABQRHGLJOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGYYTCNZXGI4TMMY>

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/timriffe/ODAPbackend/issues/33#issuecomment-2435470382, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF3HFBXCKDCDIFRHO43FBSLZ5EAONAVCNFSM6AAAAABQRHGLJOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMZVGQ3TAMZYGI . You are receiving this because you were mentioned.Message ID: @.***>

timriffe commented 28 minutes ago

idk where this example data came from, but it implies nMx values that are basically impossible. Please swap them out for something plausible. Or was there perhaps a smooth_flexible() step preceding lt_flexible() that caused a scale change somehow?