-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcor_plot.Rd
More file actions
34 lines (29 loc) · 1.19 KB
/
Copy pathcor_plot.Rd
File metadata and controls
34 lines (29 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/other-visualizations.R
\name{cor_plot}
\alias{cor_plot}
\title{Scatter Plot of Log-Transformed Values with Correlation Coefficient}
\usage{
cor_plot(data = NULL, x = NULL, y = NULL, color = "#074799", point_size = 0.5)
}
\arguments{
\item{data}{A data frame containing the variables to be plotted.}
\item{x}{A character string specifying the name of the column to be used for the x-axis.}
\item{y}{A character string specifying the name of the column to be used for the y-axis.}
\item{color}{A string specifying the color of the points. Default is "#074799".}
\item{point_size}{A numeric value indicating the size of the points. Default is 0.5.}
}
\value{
A ggplot2 object representing the scatter plot.
}
\description{
This function generates a scatter plot comparing two numeric variables (e.g., gene expression values)
after log2 transformation with pseudocount. It adds a dashed y = x reference line and overlays
a Pearson correlation coefficient using "ggpubr::stat_cor()".
}
\examples{
\dontrun{
df <- data.frame(A = rnorm(100, 10, 2), B = rnorm(100, 10, 2))
cor_plot(df, x = "A", y = "B", color = "steelblue", point_size = 1)
}
}