-
Notifications
You must be signed in to change notification settings - Fork 11
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
2. Adding model_viewer
Shiny app
#158
Conversation
Merging in devel
Merging in devel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Thank you @gareth-j . I’ve test it on the covid data in Bristol, but the model_viewer app returns the following error:
This is because of the wrong argument name used when calling the create_prediction_field
function within the functionmodel_viewer_shiny()
. It should be
create_prediction_field (…, data_dist = data_type ,…)
, rather than create_prediction_field (…, data_type = data_type ,…)
in shiny_modelviewer.R
Alternatively, this can be fixed by changing the argument name “data_dist” in create_prediction_field() in model.parse.R into “data_type”, i.e, create_prediction_field<- function (…, data_type = "Poisson"){ }
-
In the
create_prediction_field()
function in model.parse.R, it should beif (data_dist == "poisson") z <- base::exp(z)
rather thanif (data_type == "poisson") z <- base::exp(z)
Solution: I think we should use the following codes in shiny_priors.R to check and set the default CRS if it’s not given.
if ( (is.null(mesh_crs) || is.na(mesh_crs)) && (is.na(spatial_crs) || is.null(spatial_crs)) ) {
warning("Cannot read CRS from mesh or spatial_data, using default CRS = +proj=longlat +datum=WGS84")
crs <- "+proj=longlat +datum=WGS84"
} else if (is.na(mesh_crs) || is.null(mesh_crs) ) {
crs <- spatial_crs
} else {
crs <- mesh_crs
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @gareth-j, the errors are gone now.
Just a remainder that in the shiny_priors.R, the function launching the app is called interactive_priors() , but in the vignette priors_app.rmd, it's called fdmr::model_builder(...)
I just noticed that and fixed it, thanks! |
This adds a new Shiny app to view model output. It takes the output of a model run and lets the user plot a range of differnet plots and a prediction field over a leaflet map.
styler
run over codeCHANGELOG.md
file if fixing a bug or adding a new featureDESCRIPTION