Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plot.fit_model() help is incorrect and other issues #44

Open
John-R-Wallace-NOAA opened this issue Mar 3, 2020 · 0 comments
Open

plot.fit_model() help is incorrect and other issues #44

John-R-Wallace-NOAA opened this issue Mar 3, 2020 · 0 comments

Comments

@John-R-Wallace-NOAA
Copy link

The help for plot.fit_model() gives the description for the 'what' argument as:

String specifying what elements of results to plot; options include 'extrapolation_grid', 'spatial_mesh', and 'results'

However looking in the code shows that only:

c("spatial_info", "inla_mesh")

will run FishStatsUtils:::plot.make_spatial_info

Something close to:

plot.fit_model <- 
function (x, what = c("results", "all", "extrapolation_grid", "inla_mesh")[1], ...) 
{
    if (!is.character(what)) 
        stop("Check `what` in `plot.fit_model`")
    if (any(what %in% c("extrapolation_grid", "all"))) {
        cat("\n### Running `plot.make_extrapolation_info`\n")
        plot(x$extrapolation_list)
        return(invisible(NULL))
    }
    if (any(what %in% c("spatial_info", "inla_mesh", "all"))) {
        cat("\n### Running `plot.make_spatial_info`\n")
        plot(x$spatial_list)
        return(invisible(NULL))
    }
    if (any(what %in% c("results", "all"))) {
        cat("\n### Running `plot_results`\n")
        ans = plot_results(x, ...)
        return(invisible(ans))
    }
    stop("input `what` not matching available options")
}

shows available options for 'what' (except "spatial_info") when using args() or str(), keeps the "results" only default, and adds an "all" option (which could be made the default).

Also, both FishStatsUtils:::plot.make_spatial_info() and FishStatsUtils:::plot.make_extrapolation_info() do not have internal calls to png() and so the figures are not automatically saved external to R like the rest of the figures in VAST.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant