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() )
.data | The data set |
---|---|
x | The variable in data to be shown in the x axis |
y | The variable in data to be shown in the y axis |
group | The grouping variable |
fit | 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 |
level | The fonfidence level |
confidence | Display confidence interval around smooth? (TRUE by default) |
xlab | The x label |
ylab | The y label |
legend.position | The position of the legend. Defaults to 'bottom'. |
grid | Logical argument. If |
scales | If |
col | The colour to be used in the line plot and points |
alpha | The alpha for the color in confidence band |
size.shape | The size for the shape in plot |
size.line | The size for the line in the plot |
size.text | The size of the text |
fontfam | The family of the font text |
plot_theme | The graphical theme of the plot. Default is
|
An object of class gg, ggplot
.