forsys-sp / forsysr

An R implementation of the ForSys program
GNU General Public License v3.0
8 stars 3 forks source link

A switch to write results to R and not to disk #78

Closed michelledayusfs closed 1 year ago

michelledayusfs commented 1 year ago

Google asked for a switch to prevent R from writing to disk when not needed; they need this for planscape.

codyevers commented 1 year ago

Note to self: Need to rework how data is written to file. Currently, data is appended to output file after each loop, meaning that the only complete record is on disk and needs, and thus needs to be re-read back into R to output.

codyevers commented 1 year ago

forsys::run has new parameter called write_outputs. Outputs are written to file if TRUE. forsys::run also a second parameter called return_outputs. Outputs are returned to the current environment in the form of a three item list if TRUE. Those list elements are: [[1]] stand output, [[2]] project output, and [[3]] subset output.

JanLauGe commented 1 year ago

That you @codyevers, this sounds great!

michelledayusfs commented 1 year ago

This is still creating a blank output directory even when write_outputs = FALSE

codyevers commented 1 year ago

I fixed this. A directory is created is only created if write_outputs == TRUE