seacode / gmacs

A generic size-structured stock assessment model
https://seacode.github.io/gmacs
19 stars 14 forks source link

gmr clean ctl/dat function #172

Closed quantifish closed 8 years ago

quantifish commented 8 years ago

create a function that reads in the ctl/dat file and overwrites it again but formats it nicely.

jimianelli commented 8 years ago

the guts are there on each file read as gmacs_in.ctl and gmacs_in.dat. These should be set to read into R with a oneline command like the one that reads in the rep file. Did you want more ascii readable? maybe we can add some markdown solution to convert. An addition to current macro shouldn't be too hard, and wouldn't require changing other lines. I.e., change macros WRITEDAT and WRITECTL to go to a second file w/ markdown formatting...maybe?

quantifish commented 8 years ago

yeah thats basically it, but just need to add some fluff around it for matrix inputs etc. You're right it wont be hard to get this going from what we have

jimianelli commented 8 years ago

so question is to go w/ xtable or just markdown...xtable will require R code and not be so friendly, markdown could be straight in the macro possibly, and write to gmacs_input_data.md

quantifish commented 8 years ago

I guess I just had basic R in mind that just reads in everything line by line, then writes it all back out line by line, but when it writes it back out it could tab delimit rows that contain numbers/info or something to line up things nicely, and text rows could just be space delimited. That was my first idea though, sounds like your idea is probably better though. But not too sure which option to go with.

quantifish commented 8 years ago

I have a better idea for this so closing this issue.