Create a graphic to show a fitted line based on numerical variables and one grouping variable.
plot_factlines(
.data,
x,
y,
group,
fit,
level = 0.95,
confidence = TRUE,
xlab = NULL,
ylab = NULL,
legend.position = "bottom",
grid = FALSE,
scales = "free",
col = TRUE,
alpha = 0.2,
size.shape = 1.5,
size.line = 1,
size.text = 12,
fontfam = "sans",
plot_theme = theme_metan()
)
The data set
The variable in data to be shown in the x axis
The variable in data to be shown in the y axis
The grouping variable
The polynomial degree to use. It must be an integer between 1
(linear fit) to 4 (fourth-order polynomial regression.), or a numeric
vector with the same length of the variable in group
The fonfidence level
Display confidence interval around smooth? (TRUE by default)
The x label
The y label
The position of the legend. Defaults to 'bottom'.
Logical argument. If TRUE
then a grid will be created.
If grid = TRUE
scales controls how the scales are in the
plot. Possible values are 'free' (default), 'fixed', 'free_x' or 'free_y'.
The colour to be used in the line plot and points
The alpha for the color in confidence band
The size for the shape in plot
The size for the line in the plot
The size of the text
The family of the font text
The graphical theme of the plot. Default is
plot_theme = theme_metan()
. For more details, see
theme
.
An object of class gg, ggplot
.