Creates an additional plot to those created by gbm.plot within gbm.auto. Can also take Bin/Gaus_Best_line.csv or similar csvs directly. Allows changing of x axis levels and all ggplot and ggsave params.
gbm.factorplot(
x,
factorplotlevels = NULL,
ggplot2guideaxisangle = 0,
ggplot2labsx = "",
ggplot2labsy = "Marginal Effect",
ggplot2axistext = 1.5,
ggplot2axistitle = 2,
ggplot2legendtext = 1,
ggplot2legendtitle = 1.5,
ggplot2legendtitlealign = 0,
ggplot2plotbackgroundfill = "white",
ggplot2plotbackgroundcolour = "grey50",
ggplot2striptextx = 2,
ggplot2panelbordercolour = "black",
ggplot2panelborderfill = NA,
ggplot2panelborderlinewidth = 1,
ggplot2legendspacingx = grid::unit(0, "cm"),
ggplot2legendbackground = ggplot2::element_blank(),
ggplot2panelbackgroundfill = "white",
ggplot2panelbackgroundcolour = "grey50",
ggplot2panelgridcolour = "grey90",
ggplot2legendkey = ggplot2::element_blank(),
ggsavefilename = paste0(lubridate::today(), "_Categorical-variable.png"),
ggsaveplot = ggplot2::last_plot(),
ggsavedevice = "png",
ggsavepath = "",
ggsavescale = 2,
ggsavewidth = 10,
ggsaveheight = 4,
ggsaveunits = "in",
ggsavedpi = 300,
ggsavelimitsize = TRUE,
...
)
Factorial ggplot saved with users preferred location and name.
Input data.frame or tibble or csv (full file address including .csv) to read, must be a categorical variable.
Character vector of the variable's levels to reorder the x axis by, all must match those in the first column of the csv exactly. Default NULL orders from high to low Y value.
Default 0. Set at e.g. 90 to rotate.
Default: "".
Default: "Marginal Effect".
Default: 1.5.
Default: 2.
Default: 1.
Default: 1.5.
Default: 0, # otherwise effect type title centre aligned for some reason.
Default: "white", white background.
Default: "grey50", background lines.
Default: 2.
Default: "black".
Default: NA.
Default: 1.
Default: unit(0, "cm"), # compress spacing between legend items, this is min.
Default: ggplot2::element_blank().
Default: "white".
Default: "grey50".
Default: "grey90".
Default: ggplot2::element_blank().
Default: paste0(saveloc, lubridate::today(), "_SankeyAlluvial_EMT.SoEv-EfTyp_Col-EfSz.png").
Default: last_plot().
Default: "png".
Default: "".
Default: 2.
Default: 10.
Default: 4.
Default: "in".
Default: 300.
Default: TRUE.
Allow params to be called from higher function esp gbm.auto.
Simon Dedman, simondedman@gmail.com
`r lifecycle::badge("experimental")