kaitlyngaynor / gorongosa-mesocarnivores

2 stars 0 forks source link

separate scripts for data prep/running the model? #110

Closed klg-2016 closed 3 years ago

klg-2016 commented 3 years ago

https://github.com/kaitlyngaynor/gorongosa-mesocarnivores/blob/d0160437209da15344cc3a53683db9cf45ef39e6/scripts/multi-season%20model/01-multi-season-data-prep.R#L164

In this script, I bring everything together to create the data object that goes into the model. The way I currently have my code separated suggests that I was trying to create one script to prep the data, and then another to run the model. I understand how to write out a csv, for example, from code and then read it in in another script for use. Can you do the same thing with a umf data object? Or would I be better off keeping everything in this one script?

kaitlyngaynor commented 3 years ago

I might just keep everything in this script, unless it's getting too unwieldy, or if it takes ages to run the first part.

You can also save RData to disk and it will keep the objects as is for re-importing: http://www.sthda.com/english/wiki/saving-data-into-r-data-format-rds-and-rdata

klg-2016 commented 3 years ago

Thank you!