FrancescaMancini / dataxplore

Data exploration and bias assessment tool
Other
0 stars 0 forks source link

Dylan branch #1

Closed DylanCarbone closed 6 months ago

DylanCarbone commented 6 months ago

Hi @FrancescaMancini

Thanks again for letting me help you with the application!

I think I've fixed both errors to do with the time bias plotting, and the georeferencing.

For the time tab, the issue was caused by the class of the uploaded_data() which seems to be a vector:

Browse[1]> class(uploaded_data())
[1] "spec_tbl_df" "tbl_df"      "tbl"         "data.frame" 

Converting it to a data.frame object helps fix the error. I'm not sure what is causing this the object class to be a vector, but I can take a look into it :)

Also the year needs to be input as a vector, not a list, like this:

periods = unique(dat[,input$year]),

The georeferencing can be fixed by cloning the uploaded_data(), adding a latitude and longitude column values to the clone object and overwriting the uploaded_data() reactive val with the clone. Like this:

  observeEvent(input$grid_ref_convert, {
    req(uploaded_data(), lat_lon(), input$grid_ref_column)
    df <- uploaded_data()
    df$lat <- lat_lon()$lat
    df$long <- lat_lon()$lon
    uploaded_data(df)

  })

I also made a small fix to the insertUI() function to prevent it adding duplicate UI elements.

When you have the time, please could you review my changes and see if everything works for you. Please let me know if you have any questions, or we can talk about it on Wednesday.

Thanks,

Dylan

FrancescaMancini commented 6 months ago

This is great Dylan, thank you! The grid reference conversion works great. There is one thing to fix in mod_time_bias_tab.R. At the moment the plot automatically renders when the last input is selcted by the user. We want it to render only after the plot action button is clicked.

There is also one more thing to code up before the time bias module is complete, which is passing assessRecordNumber periods when the user specifies periodtype = "ranges". This is described in #4 Do you want me to merge this first before we work on these other issues?

DylanCarbone commented 6 months ago

Hi @FrancescaMancini,

When you have the time, can you please review my pull request? I have (hopefully) fixed both these issues. We can talk about the changes more during our meeting tomorrow!

Thanks,

Dylan

FrancescaMancini commented 6 months ago

Thanks Dylan! It all worked great.