Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors with regional_epinow #118

Closed
CarmenTamayo opened this issue Jan 9, 2024 · 5 comments
Closed

Errors with regional_epinow #118

CarmenTamayo opened this issue Jan 9, 2024 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@CarmenTamayo
Copy link
Contributor

When running regional_epinow in the transmissibility pipeline:

res_epinow2_group <- regional_epinow(dat_i_day, generation_time = generation_time, stan = stan_opts(samples = 1e3, chains = 2), rt = rt_opts(gp_on = "R0"), horizon = 0, CrIs = c(0.5, 0.95), return_output = TRUE, verbose = FALSE, logs = NULL )

The code runs but I'm getting a series of errors which result in the output not having any data for the different regions, here is an example for London, but the same error is generated for the remaining regions of the country:

INFO [2024-01-09 13:03:58] Initialising estimates for: London
ERROR [2024-01-09 13:03:58] London: 'names' attribute [1] must be the same length as the vector [0] - <-, names(ids), paste(names(type_n), "id", sep = "
")
INFO [2024-01-09 13:03:59] Completed regional estimates
INFO [2024-01-09 13:03:59] Regions with estimates: 0
INFO [2024-01-09 13:03:59] Runtime error in London : London: 'names' attribute [1] must be the same length as the vector [0] - <-, names(ids), paste(names(type_n), "id", sep = "")_
INFO [2024-01-09 13:03:59] Producing summary
INFO [2024-01-09 13:03:59] No summary directory specified so returning summary output
INFO [2024-01-09 13:03:59] Errors caught whilst generating summary statistics:
INFO [2024-01-09 13:03:59] Error in .checkTypos(e, names_x): Object 'variable' not found amongst

@jamesmbaazam do you know what the problem could be? I'm sure it's easy to fix but I've been looking at the R file for epinow and I'm not sure at what point the error is happening

Thanks!

@CarmenTamayo CarmenTamayo added the help wanted Extra attention is needed label Jan 9, 2024
@jamesmbaazam
Copy link
Member

Thanks for tagging me. I'll take a look tomorrow.

@jamesmbaazam
Copy link
Member

Hi @CarmenTamayo, I think you're getting the error because you are not wrapping the generation_time object passed to the generation_time argument in a call to generation_time_opts(). So, you should have something like

regional_epinow(
	dat_i_day, 
---  generation_time = generation_time, 
+++  generation_time =  generation_time_opts(generation_time), 
	stan = stan_opts(samples = 1e3, chains = 2),
	rt = rt_opts(gp_on = "R0"),
	horizon = 0, CrIs = c(0.5, 0.95),
	return_output = TRUE,
	verbose = FALSE,
	logs = NULL
) 

@CarmenTamayo
Copy link
Contributor Author

Sorry @jamesmbaazam for the delay- I tried and the error persists... what else could be causing this error?
thank you

@jamesmbaazam
Copy link
Member

Hi @CarmenTamayo, sorry to hear that. I'll dig into it now. Which branch are you experiencing this issue working on?

@CarmenTamayo
Copy link
Contributor Author

Fixed in #144

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants