nplots_scatter: nplots_scatter : Generate scatter plots using ggplot2

Description Usage Arguments Details Value Examples

View source: R/nplots_scatter.R

Description

This function takes your plot arguments like the data, aesthetics, plot labels, desired layers and creates a scatter plot for you using ggplot2. You don't have to worry about writing a bunch of lines of code. This function takes care ofthat for you!

Usage

1
2
nplots_scatter(x, x_variable, y_variable, xlab = "", ylab = "",
  title = "", plotly = TRUE, alpha = 0.2, hjust = 0.5)

Arguments

x

The dataset to be used

x_variable

x-axis variable for the scatter plot

y_variable

y-axis variable for thescatter plot

xlab

argument to specify x axis label

ylab

argument to specify y axis label

title

argument to specify the plot title to be applied

plotly

argument to specify whether the genereated plot should be rendered as a plotly plot

alpha

argument to specify geom_poin opacity or transparency magnitude

hjust

argument to specify horizontal justification of the plot title

Details

This function takes plot the specified plot arguments and produces a scatter plot using - nplots_scatter with the background machinery being ggplot2. Future versions of this function will provide an inclusion of other plot layers and objects to work with.

Value

scatter plot

Examples

1
2
\code {nplots_scatter(gapminder, gapminder$lifeExp, gapminder$gdpPercap, xlab="lifeExp", ylab="gdpPercap", title="lifeExp Vs GdpPercap", plotly=FALSE)}
\code {nplots_scatter(iris, iris$Sepal.Width, iris$Sepal.Length, xlab="Sepal.Width", ylab="Sepal.Length", title="Sepal Width Vs Length", plotly=FALSE)}

STAT545-UBC-students/hw07-rasiimwe documentation built on May 5, 2019, 7:07 a.m.