ggscatterstats

0th

Percentile

scatterplot with ggMarginals

Scatterplots from `ggplot2`` combined with add marginal histograms/boxplots/density plots with statistical details added as a subtitle.

Arguments
data

Dataframe from which variables specified are preferentially to be taken.

x

A vector containing the explanatory variable.

y

The response - a vector of length the number of rows of x.

xlab

Label for x axis variable.

ylab

Label for y axis variable.

line.colour

Colour for the regression line.

marginal

Decides whether ggExtra::ggMarginal() plots will be displayed; the default is TRUE.

marginal.type

Type of marginal distribution to be plotted on the axes ("histogram", "boxplot", "density", "violin").

xfill

Colour fill for x axis distibution (default: orange).

yfill

Colour fill for y axis distribution (default: green).

type

Type of association between paired samples required ("parametric: Pearson's product moment correlation coefficient" or "nonparametric: Spearman's rho" or "robust: Robust regression using an M estimator"). Corresponding abbreviations are also accepted: "p" (for parametric/pearson's), "np" (nonparametric/spearman), "r" (robust), resp.

results.subtitle

Decides whether the results of statistical tests are to be displayed as subtitle.

intercept

Decides whether "mean" or "median" or no intercept lines (NULL) are to be plotted.

title

The text for the plot title.

caption

The text for the plot caption.

maxit

Maximum number of iterations for robust linear regression or bootstrap samples to compute Spearman's rho confidence intervals.

k

Number of decimal places expected for results.

width.jitter

Degree of jitter in x direction. Defaults to 40% of the resolution of the data.

height.jitter

Degree of jitter in y direction. Defaults to 40% of the resolution of the data.

messages

Decides whether messages references, notes, and warnings are to be displayed (Default: TRUE).

Note

If you want to use marginal.type = "violin", you will have to use development version of ggExtra

Aliases
  • ggscatterstats
Examples
# NOT RUN {
library(datasets)

# simple function call with the defaults
ggstatsplot::ggscatterstats(
data = datasets::mtcars,
x = wt,
y = mpg
)

# more detailed function call
ggstatsplot::ggscatterstats(
data = datasets::iris,
x = Petal.Length,
y = Sepal.Length,
intercept = 'median',
type = 'robust',
marginal.type = 'density'
)

# }
Documentation reproduced from package ggstatsplot, version 0.0.1, License: GPL-3 | file LICENSE

Community examples

Looks like there are no examples yet.