GLEON / GLM3r

R package for basic GLM model running (version 3.0)
3 stars 15 forks source link

ability to capture GLM version as a character #23

Closed jordansread closed 2 years ago

jordansread commented 2 years ago

Right now glm_version() prints the standard out message from the model in the console, but doesn't return a useful value.

       ----------------------------------------------------
       |  General Lake Model (GLM)   Version 3.0.5        |
       ----------------------------------------------------
glm built using gcc version 4.2.1
--help  : show this blurb
--nml <nmlfile> : get parameters from nmlfile
--xdisp : display temp/salt and selected others in x-window
--xdisp <plotsfile> : like --xdisp, but use <plotsfile> instead of plots.nml
--saveall : save plots to png files
--save-all-in-one : save all plots to png file
--save-all-in-one <destfile> : save all plots to png file <destfile>
[1] 0

Perhaps an optional arg to this function could specify that we want the version number as a string, such that

glm_version(as_char = TRUE)
[1] "3.0.5"

i think this is possible by allowing stdout = TRUE to be used when calling for the version, and then also parsing the response to extract the version.