View source: R/scatter-plots.R
scatplot | R Documentation |
Scatter plot of two columns of a data.frame after possible log2 transformation.
scatplot(data, x, y, title, xlabs, ylabs, min, max, a = 0.65,
log2 = TRUE, xcor = 3.3, ycor = 16.999, binx = 0.2, biny = 0.2,
methodcor = "all", usecor = "pairwise.complete.obs", dens = TRUE,
rug = TRUE, geomsize = 2, fig = "all", scaleCol, smooth = TRUE,
smoothMethod = "gam",
smoothFormula = as.formula("y ~ s(x, bs = 'cs')"), xmin, ymin, xmax,
ymax, abline = TRUE, publi = TRUE, col = NULL, labCol,
verbose = FALSE)
data |
numeric data.frame |
x |
column name to be mapped to the x-axis |
y |
column name to be mapped to the y-axis |
title |
plot title |
xlabs |
x-axis title |
ylabs |
y-axis title |
min |
numeric, minimum of both x-axis and y-axis |
max |
numeric, maximum of both x-axis and y-axis |
a |
numeric, alpha scaling factor to apply to the data |
log2 |
logical, default TRUE. Whether the data should be log2 transformed before plotting |
xcor |
numeric, x coordinate for the correlation annotation to be anchored on its center |
ycor |
numeric, y coordinate for the correlation annotation to be anchored |
binx |
numeric, bin to use for the marginal plot of the x-axis |
biny |
numeric, bin to use for the marginal plot of the y-axis |
methodcor |
'all' for both Spearman and Pearson or or 'spearman' or 'pearson' |
usecor |
an optional character string giving a method for computing the correlation in the presence of missing values. This must be (an abbreviation of) one of the strings "everything", "all.obs", "complete.obs", "na.or.complete", or "pairwise.complete.obs" (default). |
dens |
logical, default TRUE. Whether density countour curves should be added to the main figure |
rug |
logical, default TRUE. Whether a rug should be added on the main figure |
geomsize |
numeric, default 2. the size of the geom_point() |
fig |
character string to chose from a set of predefined options that allows different outputs 'all' : complete figure with annotation and marginal plots 'grob': list of the grobs use by gridExtra::arrangeGrob to create the plot 'list': list of the different plots 'p' : the main figure with the legend 'p1' : the main figure without the legend 'p2' : the marginal figure on the x-axis 'p3' : the marginal figure on the y-axis 'legend': the legend of the figure only |
scaleCol |
colour palette to use for the plot |
smooth |
logical; default TRUE whether a smooth curve should be plotted |
smoothMethod |
string, method to use for the smoothing default: "gam" (from mgcv package) |
smoothFormula |
formula to use with the smooth method default: as.formula("y ~ s(x, bs = 'cs')") |
xmin |
numeric, minimum of the x-axis |
ymin |
numeric, minimum of the y-axis |
xmax |
numeric, maximum of the x-axis |
ymax |
numeric, maximum of the y-axis |
abline |
logical; default: TRUE; whether the line y=x should be added as a reference |
publi |
logical, default: TRUE; whether to apply the theme_bw which is better suited for publication |
col |
colour palette |
labCol |
title for the colour scale |
verbose |
logical; default FALSE |
a plot (see parameter fig for better description)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.