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

Summary table bug on Plot/Statistics tab #139

Open
aylapear opened this issue Jan 25, 2022 · 4 comments
Open

Summary table bug on Plot/Statistics tab #139

aylapear opened this issue Jan 25, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@aylapear
Copy link
Collaborator

Was unsure if I introduced bug while fixing other parts but check by switching to a previous SHA before I did any work and the bug is still present. When you click on the summary tab in Tab 5 Plot/Statistics the app throws an error. Tried various stations-variable combinations and it throws the error. The error is pasted below

Warning in survreg.fit(X, Y, weights, offset, init = init, controlvals = control,  :
  Ran out of iterations and did not converge
Warning: Error in <-: 'names' attribute [4] must be the same length as the vector [0]
  138: .local
  137: mean
  135: .fun
  134: <Anonymous>
  132: llply
  131: ldply
  130: plyr::ddply
  129: wqbc::summarise_wqdata
  124: <reactive> [/Users/aylapearson/Applications/shinyrems/R/mod_results.R#188]
  108: summary_table
  105: exprFunc [/Users/aylapearson/Applications/shinyrems/R/mod_results.R#199]
  104: widgetFunc
  103: ::
htmlwidgets
shinyRenderWidget
  102: func
   89: renderFunc
   88: renderFunc
   84: renderFunc
   83: output$results_ui_1-table
    2: shiny::runApp
    1: shinyrems::run_ems_app [/Users/aylapearson/Applications/shinyrems/R/run_app.R#71]
@aylapear aylapear added the bug Something isn't working label Jan 25, 2022
@aylapear aylapear self-assigned this Jan 25, 2022
@aylapear
Copy link
Collaborator Author

Issue related to wqbc bcgov/wqbc#163

@aylapear
Copy link
Collaborator Author

This is occurring due to the edge cases when all the values are censored or only a single value remains for the site. I think that we can change the function to output NA's instead of an error message. That will allow sites/chemicals that have no values to have NA's displayed in the row and not cause an error so the table can generate.

@aylapear
Copy link
Collaborator Author

Instead of an error that causes the whole tab to fail you would generate a table like this that displays each site/chemical

# A tibble: 2 × 14
  Variable       EMS_ID      n  ncen   min   max  mean median lowerQ upperQ     sd     se lowerCL upperCL
  <chr>          <chr>   <int> <int> <dbl> <dbl> <dbl>  <dbl>  <dbl>  <dbl>  <dbl>  <dbl>   <dbl>   <dbl>
1 Nitrogen Total 0200016     3     0 0.754 0.949 0.849  0.845  0.793  0.901 0.0799 0.0461   0.763   0.944
1 Nitrogen Total 0478416     NA          NA      NA      NA       NA       NA      NA        NA       NA        NA        NA

@aylapear
Copy link
Collaborator Author

Updates to wqbc now allow the Summary Table tab under the Plot/Statistics section to work and not error out when some of the sites do not have a calculated summary.

Screenshot 2022-12-30 at 8 05 22 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant