BioDT / uc-ces

Modelling code for cultural ecosystem services pDT within BioDT
https://wiki.eduuni.fi/display/cscRDIcollaboration/4.1.1.2.1+Cultural+Ecosystem+Services
MIT License
2 stars 0 forks source link

Move R code for autogenerating ODMAP into separate .R script #32

Closed simonrolph closed 2 days ago

simonrolph commented 2 weeks ago

Take lines 418 onwards https://github.com/BioDT/uc-ces/blob/main/biodiversity_model/biodiversity_model_workflow_flexsdm_ODMAP.Rmd#L418 and turn into a function that can be placed in a different R file. Suggested file name generate_odmap.R with a function generate_odmap()? Not sure what arguments the function would need?

I think it would be best to put the R file in this folder https://github.com/BioDT/uc-ces/tree/main/biodiversity_model/R

DylanCarbone commented 4 days ago

Hi @simonrolph,

Please see the render_ODMAP.r R file I have created here. I've also included the helper functions that navigate the ODMAP dictionary to obtain element definitions.

The approach I have taken to ODMAP report generation here has been to specify each of the ODMAP IDs as function parameters, with the exception of fields that are generated automatically from objects in the SDM model workflow. The ODMAP report generation chunk in the sdm workflow has also been shorted, here.

Thanks,

Dylan