NewGraphEnvironment / dff-2022

Building digital field forms and processing data collected using R, postgresql, QGIS and other tools
Creative Commons Zero v1.0 Universal
0 stars 3 forks source link

`fiss_site_tidy` script build of fiss_site dataframe from mergin import fails due to column type mismatches #149

Closed Mateo9569 closed 8 months ago

Mateo9569 commented 8 months ago

Similar issue for reference last year here. I don't remember this ever being fully resolved. The problem occurs when building the loc form and again when building the site form site form. What is the easiest way to get around this? Other than to convert the types of every column individually. Maybe I'm missing something. When reading in the empty template using fpr::fpr_import_hab_con(backup = F, row_empty_remove = T), does it need to be populated with a row of data so that R knows the column types?

NewGraphEnvironment commented 8 months ago

yup. we need to use a populated version. We have one in dff

https://github.com/NewGraphEnvironment/dff-2022/blob/master/data/FDS_Template2021-01-28.xls

however - since we have a new version we may as well populate it similiar to the 2021 version. We can keep the master here for now and just read it in direct for field form processing https://github.com/NewGraphEnvironment/dff-2022/tree/master/data/templates

in each report repo Let's perhaps keep an exact copy of the dff template in a directory called data/inputs_raw

it is this row of the function that checks for types.
image

relates to https://github.com/NewGraphEnvironment/fpr/issues/6 - need to build fpr_xref for the input call eventually but that can take some time and using the dff populated template should perhaps work for now (will prob come up again later somewhere...)