quantifish / rlsd

The LSD R package
Other
1 stars 0 forks source link

lsd_plot logic is bad #9

Open quantifish opened 7 years ago

quantifish commented 7 years ago

The section of code I am referring to is this:

if (!file.exists("lsd.rds")) {
    object <- lsd::do_extract(data = TRUE, mcmc = TRUE, map = TRUE, model = "lsd")
    lsd::lsdSave(object)
} else {
    object <- readRDS("lsd.rds")
}

So this looks for 'lsd.rds' and if it doesn't find it then extracts the latest model run and creates it, but if it does find 'lsd.rds' then it loads it but does not extract any new model runs if it does this.

quantifish commented 7 years ago

Also, the R function 'do_extract' should automatically search for map and mcmc outputs rather than the user having to specify that they are available.