plot_scatter {inferCSN} | R Documentation |
plot_scatter
Description
plot_scatter
Usage
plot_scatter(
data,
smoothing_method = "lm",
group_colors = RColorBrewer::brewer.pal(9, "Set1"),
title_color = "black",
title = NULL,
col_title = NULL,
row_title = NULL,
legend_title = NULL,
legend_position = "bottom",
margins = "both",
marginal_type = NULL,
margins_size = 10,
compute_correlation = TRUE,
compute_correlation_method = "pearson",
keep_aspect_ratio = FALSE,
facet = FALSE,
se = FALSE,
pointdensity = TRUE
)
Arguments
data |
Input data |
smoothing_method |
Method for smoothing curve, "lm" or "loess". |
group_colors |
Colors for different groups. |
title_color |
Color for the title. |
title |
Main title for the plot. |
col_title |
Title for the x-axis. |
row_title |
Title for the y-axis. |
legend_title |
Title for the legend. |
legend_position |
The position of legend. |
margins |
The position of marginal figure ("both", "x", "y"). |
marginal_type |
The type of marginal figure ("density", "histogram", "boxplot", "violin", "densigram"). |
margins_size |
The size of marginal figure, note the bigger size the smaller figure. |
compute_correlation |
Whether to compute and print correlation on the figure. |
compute_correlation_method |
Method to compute correlation ("pearson" or "spearman"). |
keep_aspect_ratio |
Logical value, whether to set aspect ratio to 1:1. |
facet |
Faceting variable. If setting TRUE, all settings about margins will be inalidation. |
se |
Display confidence interval around smooth. |
pointdensity |
Plot point density when only provide 1 cluster. |
Value
ggplot object
Examples
data("example_matrix")
test_data <- data.frame(
example_matrix[1:200, c(1, 7)],
c = c(
rep("c1", 40),
rep("c2", 40),
rep("c3", 40),
rep("c4", 40),
rep("c5", 40)
)
)
p1 <- plot_scatter(
test_data,
keep_aspect_ratio = TRUE
)
p2 <- plot_scatter(
test_data,
marginal_type = "boxplot",
keep_aspect_ratio = TRUE
)
p1 + p2
p3 <- plot_scatter(
test_data,
facet = TRUE,
keep_aspect_ratio = TRUE
)
p3
p4 <- plot_scatter(
test_data[, 1:2],
marginal_type = "histogram",
keep_aspect_ratio = TRUE
)
p4