pfmc-assessments / lingcod

2 stars 2 forks source link

add columns to models/README.md, be able to extract list of scripts for changing models #53

Closed iantaylor-NOAA closed 3 years ago

iantaylor-NOAA commented 3 years ago

The models/README.md file has a source column which is a combination of source model file and the name of an R script with commands to get from the source model to the new one.

This column could be split into separate source_model and script columns to facilitate extracting a list of scripts associated with changes in the models.

The get_dir_ling() function currently parses this README and finds the value in the name column which matches the inputs provided about the model. This function could be expanded or replaced or turned into a wrapper for a new function which gets info from the other columns in the table.

iantaylor-NOAA commented 3 years ago

I just split the models/README.md columns as proposed above in commit f128365754bb93a83b3e68f62e39221beebbd8ef @kellijohnson-NOAA added the new get_mdtable() function which exactly solves the problem of getting info from other columns in commit 54fcaa212b527d5032c2893d99da0c20d7e43b36.

Function call get_mdtable(file.path("models", "README.md"), "# table") gets all the info from all the columns of that table for future use in describing the exact bridging path between old and new models and helping fill in the gaps later on.